Merge pull request #135 from Sonicadvance1/jmp_emitter

Change the x86emitter jmp emitter from using s32 to sptr.
This commit is contained in:
sudonim1 2014-07-15 22:16:04 +01:00
commit 7a1ebd22ed
1 changed files with 6 additions and 1 deletions

View File

@ -126,7 +126,12 @@ __emitinline void xJccKnownTarget( JccComparisonType comparison, const void* tar
{
// Perform a 32 bit jump instead. :(
s32* bah = xJcc32( comparison );
*bah = (s32)target - (s32)xGetPtr();
sptr distance = (sptr)target - (sptr)xGetPtr();
// This assert won't physically happen on x86 targets
pxAssertDev(distance >= -0x80000000LL && distance < 0x80000000LL, "Jump target is too far away, needs an indirect register");
*bah = (s32)distance;
}
}