Jit64: Fix the offsetAddedToAddress correction

The LEA that the signal handler is trying to undo the effects of is a
32-bit instruction, and the value in the register prior to the LEA is
also 32-bit, so the signal handler should use a 32-bit write.

(Actually, in the end this doesn't really matter, because the first
instruction that reads this value after backpatching is also a 32-bit
instruction...)
This commit is contained in:
JosJuice 2023-01-14 18:47:37 +01:00
parent e65167f9cd
commit 78c53bfec8
1 changed files with 1 additions and 1 deletions

View File

@ -329,7 +329,7 @@ bool Jit64::BackPatch(SContext* ctx)
if (info.offsetAddedToAddress)
{
u64* ptr = ContextRN(ctx, info.op_arg.GetSimpleReg());
*ptr -= static_cast<u32>(info.offset);
*ptr = static_cast<u32>(*ptr - info.offset);
}
ctx->CTX_PC = reinterpret_cast<u64>(trampoline);