Skip to content

Commit

Permalink
Merge pull request #18629 from unknownbrackets/unbreak-jithacks
Browse files Browse the repository at this point in the history
Core: Revert save state breakage
  • Loading branch information
hrydgard committed Dec 29, 2023
2 parents ecb7f93 + c243f39 commit c97d5ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Core/SaveState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ namespace SaveState
}

// Memory is a bit tricky when jit is enabled, since there's emuhacks in it.
// These must be saved before copying out memory and restored after.
auto savedReplacements = SaveAndClearReplacements();
if (MIPSComp::jit && p.mode == p.MODE_WRITE) {
std::lock_guard<std::recursive_mutex> guard(MIPSComp::jitLock);
if (MIPSComp::jit) {
Expand All @@ -388,7 +390,6 @@ namespace SaveState
// Don't bother restoring if reading, we'll deal with that in KernelModuleDoState.
// In theory, different functions might have been runtime loaded in the state.
if (p.mode != p.MODE_READ) {
auto savedReplacements = SaveAndClearReplacements();
RestoreSavedReplacements(savedReplacements);
}

Expand Down

0 comments on commit c97d5ef

Please sign in to comment.