Don't run FindLibrary before actually checking id size (#5157)

Ancient libSceFios2 versions have a module_stop export which falls into the `ids.size() == 1 && sym_type == Loader::SymbolType::NoType` branch. Because we were initializing library and module up here, the game was accessing oob indexes and causing debug asserts.
This commit is contained in:
Stephen Miller authored and GitHub committed 2026-09-27 23:24:31 -07:00
1 parent 4cbd23ef6d
commit e868daca08
1 file changed
+2 -2
+2 -2
View File
@@ -391,8 +391,8 @@ void Linker::Relocate(Module* module) {
bool Linker::Resolve(const std::string& name, Loader::SymbolType sym_type, Module* m,
Loader::SymbolRecord* return_info) {
const auto ids = Common::SplitString(name, '#');
const LibraryInfo* library = m->FindLibrary(ids[1]);
const ModuleInfo* module = m->FindModule(ids[2]);
const LibraryInfo* library;
const ModuleInfo* module;
if (ids.size() != 3 && sym_type != Loader::SymbolType::NoType) {
return_info->virtual_address = 0;
return_info->symbol.name = ids.at(0);