PSFLoader: Fix recursive _lib loading (#3489)

This commit is contained in:
Nahuel Gaitan 2025-07-22 08:08:45 -03:00 committed by GitHub
parent 46a071f3e7
commit 56b5b337aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -193,14 +193,12 @@ bool PSFLoader::LoadLibraryPSF(const std::string& path, bool use_pc_sp, Error* e
const std::string lib_path = Path::BuildRelativePath(path, lib_name.value()); const std::string lib_path = Path::BuildRelativePath(path, lib_name.value());
INFO_LOG("Loading parent PSF '{}'", Path::GetFileName(lib_path)); INFO_LOG("Loading parent PSF '{}'", Path::GetFileName(lib_path));
// We should use the initial SP/PC from the **first** parent lib. // We should use the initial SP/PC from the deepest **first** parent lib.
const bool lib_use_pc_sp = (depth == 0); if (!LoadLibraryPSF(lib_path.c_str(), use_pc_sp, error, depth + 1))
if (!LoadLibraryPSF(lib_path.c_str(), lib_use_pc_sp, error, depth + 1))
return false; return false;
// Don't apply the PC/SP from the minipsf file. // Don't apply the PC/SP from the minipsf file.
if (lib_use_pc_sp) use_pc_sp = false;
use_pc_sp = false;
} }
// apply the main psf // apply the main psf