Savestate: Rehash analyzed functions before writing replacements on load

The function list is from before the load, where other code (an overlay
module) may have been. Hashing it again from the loaded memory keeps the
hooks to code that actually matches.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-09-28 09:34:06 -06:00
1 parent 639e57c2bd
commit 06e11fb176
3 files changed
+11

No files matched your search

+3
View File
@@ -503,6 +503,9 @@ void __KernelModuleDoState(PointerWrap &p) {
}
}
}
// The functions were found in memory from before the load, where other code may have been
// (an overlay module, say.) Hash them from what's there now, so a hook only goes where it matches.
MIPSAnalyst::RehashFunctions();
if (g_Config.bFuncReplacements) {
MIPSAnalyst::ReplaceFunctions();
}