From 01c822e03d1b7b6b50cb137038dbe95eb65ac2ac Mon Sep 17 00:00:00 2001 From: Yuxiao Mao Date: Mon, 25 Nov 2024 12:37:21 +0100 Subject: [PATCH] Fix evalCall corrupting R10, R11 --- hld/Eval.hx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hld/Eval.hx b/hld/Eval.hx index 7806809..a1d625a 100644 --- a/hld/Eval.hx +++ b/hld/Eval.hx @@ -411,7 +411,8 @@ class Eval { } var nextCpu = 0, nextFpu = 0; - var callRegs = jit.isWinCall ? [Ecx, Edx, R8, R9] : [Edi, Esi, Edx, Ecx, R8, R9]; + // Save all SCRATCH_REGS because we might be in the middle of a function + var callRegs = jit.isWinCall ? [Ecx, Edx, R8, R9, R10, R11] : [Edi, Esi, Edx, Ecx, R8, R9, R10, R11]; for( i => r in callRegs ) { pushReg(r); pushReg(NativeReg.XMM(i));