From 6fae78cd3f4634f7f4dfa8e91ff69bd513f8b336 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 12 Oct 2014 12:44:51 -0700 Subject: [PATCH] x86jit: Fix a bug in branch continuing. When we predict it won't take a likely delay slot, we'd lose our register allocation state. --- Core/MIPS/x86/CompBranch.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Core/MIPS/x86/CompBranch.cpp b/Core/MIPS/x86/CompBranch.cpp index 6f7d4444f4..eaaa69f384 100644 --- a/Core/MIPS/x86/CompBranch.cpp +++ b/Core/MIPS/x86/CompBranch.cpp @@ -189,7 +189,12 @@ void Jit::CompBranchExits(CCFlags cc, u32 targetAddr, u32 notTakenAddr, bool del if (predictTakeBranch) GetStateAndFlushAll(state); else + { + // We need to get the state BEFORE the delay slot is compiled. + gpr.GetState(state.gpr); + fpr.GetState(state.fpr); CompileDelaySlot(DELAYSLOT_FLUSH); + } } if (predictTakeBranch)