Merge pull request #9791 from JosJuice/jitarm64-carbon

JitArm64: Fix clobbering LR in FakeLKExit
This commit is contained in:
Markus Wick 2021-06-06 23:15:24 +02:00 committed by GitHub
commit fd4efd3787
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;