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.
This commit is contained in:
Ryan Houdek 2014-04-04 11:45:56 -05:00 committed by Sean
parent b388123280
commit 93c871522f

View File

@ -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)