Skip to content

Commit

Permalink
armjit: Fix BKPT on simple exits.
Browse files Browse the repository at this point in the history
If we get lucky and write a single-op destination address, we only emit
one op.  So we have to check the next op before overwriting.
  • Loading branch information
unknownbrackets committed Dec 23, 2014
1 parent cb50075 commit 326c298
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Core/MIPS/JitCommon/JitBlockCache.cpp
Expand Up @@ -415,12 +415,12 @@ void JitBlockCache::LinkBlockExits(int i) {
}
ARMXEmitter emit(b.exitPtrs[e]);
emit.B(blocks_[destinationBlock].checkedEntry);
u32 op = 0;
u32 op = *((const u32 *)emit.GetCodePtr());
// Overwrite with nops until the next unconditional branch.
do {
while ((op & 0xFF000000) != 0xEA000000) {
emit.BKPT(1);
op = *((const u32 *)emit.GetCodePtr());
} while ((op & 0xFF000000) != 0xEA000000);
}
emit.BKPT(1);
emit.FlushIcache();
b.linkStatus[e] = true;
Expand Down

1 comment on commit 326c298

@hrydgard
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, another good catch! Silly me...

Please sign in to comment.