mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
JIT: fix memcheck with stXx
This commit is contained in:
@ -435,10 +435,11 @@ void Jit64::stXx(UGeckoInstruction inst)
|
|||||||
|
|
||||||
int a = inst.RA, b = inst.RB, s = inst.RS;
|
int a = inst.RA, b = inst.RB, s = inst.RS;
|
||||||
FALLBACK_IF(!a || a == s || a == b);
|
FALLBACK_IF(!a || a == s || a == b);
|
||||||
|
bool update = !!(inst.SUBOP10 & 32);
|
||||||
|
|
||||||
gpr.Lock(a, b, s);
|
gpr.Lock(a, b, s);
|
||||||
|
|
||||||
if (inst.SUBOP10 & 32)
|
if (update)
|
||||||
{
|
{
|
||||||
gpr.BindToRegister(a, true, true);
|
gpr.BindToRegister(a, true, true);
|
||||||
ADD(32, gpr.R(a), gpr.R(b));
|
ADD(32, gpr.R(a), gpr.R(b));
|
||||||
@ -485,6 +486,14 @@ void Jit64::stXx(UGeckoInstruction inst)
|
|||||||
}
|
}
|
||||||
SafeWriteRegToReg(reg_value, RSCRATCH2, accessSize, 0, CallerSavedRegistersInUse());
|
SafeWriteRegToReg(reg_value, RSCRATCH2, accessSize, 0, CallerSavedRegistersInUse());
|
||||||
|
|
||||||
|
if (update && js.memcheck)
|
||||||
|
{
|
||||||
|
// revert the address change if an exception occurred
|
||||||
|
MEMCHECK_START(true)
|
||||||
|
SUB(32, gpr.R(a), gpr.R(b));
|
||||||
|
MEMCHECK_END;
|
||||||
|
}
|
||||||
|
|
||||||
gpr.UnlockAll();
|
gpr.UnlockAll();
|
||||||
gpr.UnlockAllX();
|
gpr.UnlockAllX();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user