From 354e25582792d77e4b4b69686650a0f9d73b4b0a Mon Sep 17 00:00:00 2001 From: Fiora Date: Fri, 26 Dec 2014 12:32:42 -0800 Subject: [PATCH] JIT: fix carry optimization on blocks that end early I don't know if this shows up currently, but e.g. if you force blocks to be under a certain length, this problem (a crash) shows up. --- Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp index 0914f14d13..a272d120dd 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp @@ -57,7 +57,7 @@ void Jit64::FinalizeCarry(CCFlags cond) if (js.op->wantsCA) { // Be careful: a breakpoint kills flags in between instructions - if (js.next_op->wantsCAInFlags && !js.next_inst_bp) + if (!js.isLastInstruction && js.next_op->wantsCAInFlags && !js.next_inst_bp) { if (cond == CC_C || cond == CC_NC) { @@ -86,7 +86,7 @@ void Jit64::FinalizeCarry(bool ca) js.carryFlagInverted = false; if (js.op->wantsCA) { - if (js.next_op->wantsCAInFlags) + if (!js.isLastInstruction && js.next_op->wantsCAInFlags && !js.next_inst_bp) { if (ca) STC();