From 93c871522f4dbbec54beaeeb4940b1caa8c87e5b Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Fri, 4 Apr 2014 11:45:56 -0500 Subject: [PATCH] Fix a bug in the ARMEmitter. When creating a Fixupbranch we were swapping the BL and B targets. I think this was found by PPSSPP a while ago, but they never send PRs to merge their changes upstream. --- Source/Core/Common/ArmEmitter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/Common/ArmEmitter.cpp b/Source/Core/Common/ArmEmitter.cpp index ded0944e57..ccd05d4c45 100644 --- a/Source/Core/Common/ArmEmitter.cpp +++ b/Source/Core/Common/ArmEmitter.cpp @@ -401,7 +401,7 @@ void ARMXEmitter::SetJumpTarget(FixupBranch const &branch) _dbg_assert_msg_(DYNA_REC, distance > -0x2000000 && distance <= 0x2000000, "SetJumpTarget out of range (%p calls %p)", code, branch.ptr); u32 instr = (u32)(branch.condition | ((distance >> 2) & 0x00FFFFFF)); - instr |= branch.type ? /* B */ 0x0A000000 : /* BL */ 0x0B000000; + instr |= (0 == branch.type) ? /* B */ 0x0A000000 : /* BL */ 0x0B000000; *(u32*)branch.ptr = instr; } void ARMXEmitter::B(const void *fnptr)