From e868daca088f5ae6f171f3dfca0ac9dfc2df4602 Mon Sep 17 00:00:00 2001 From: Stephen Miller <56742918+StevenMiller123@users.noreply.github.com> Date: Mon, 28 Sep 2026 01:24:31 -0500 Subject: [PATCH] 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. --- src/core/linker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/linker.cpp b/src/core/linker.cpp index bd1dbd80b..8251e5b1e 100644 --- a/src/core/linker.cpp +++ b/src/core/linker.cpp @@ -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);