mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-03 19:41:45 +02:00
JitArm64: Fix clobbering LR in FakeLKExit
Fixes Need for Speed: Carbon accessing invalid memory when branch following and BLR optimization are enabled simultaneously.
This commit is contained in:
parent
684d09b342
commit
4ef4ac41d1
@ -398,6 +398,7 @@ void JitArm64::FakeLKExit(u32 exit_address_after_return)
|
|||||||
|
|
||||||
// We may need to fake the BLR stack on inlined CALL instructions.
|
// We may need to fake the BLR stack on inlined CALL instructions.
|
||||||
// Else we can't return to this location any more.
|
// Else we can't return to this location any more.
|
||||||
|
gpr.Lock(ARM64Reg::W30);
|
||||||
ARM64Reg after_reg = gpr.GetReg();
|
ARM64Reg after_reg = gpr.GetReg();
|
||||||
ARM64Reg code_reg = gpr.GetReg();
|
ARM64Reg code_reg = gpr.GetReg();
|
||||||
MOVI2R(after_reg, exit_address_after_return);
|
MOVI2R(after_reg, exit_address_after_return);
|
||||||
@ -406,6 +407,7 @@ void JitArm64::FakeLKExit(u32 exit_address_after_return)
|
|||||||
gpr.Unlock(after_reg, code_reg);
|
gpr.Unlock(after_reg, code_reg);
|
||||||
|
|
||||||
FixupBranch skip_exit = BL();
|
FixupBranch skip_exit = BL();
|
||||||
|
gpr.Unlock(ARM64Reg::W30);
|
||||||
|
|
||||||
// Write the regular exit node after the return.
|
// Write the regular exit node after the return.
|
||||||
JitBlock* b = js.curBlock;
|
JitBlock* b = js.curBlock;
|
||||||
|
Loading…
Reference in New Issue
Block a user