From e6d37a3850ad00e012be561ae9a381115b128883 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 2 Mar 2008 18:18:42 +0000 Subject: [PATCH] fixed a serious codegen bug where profiled internal functions in plugins could have their return values smashed. this only affected plugins being internally profiled --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401919 --- sourcepawn/jit/x86/jit_x86.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sourcepawn/jit/x86/jit_x86.cpp b/sourcepawn/jit/x86/jit_x86.cpp index 6f3d5138..6103f3da 100644 --- a/sourcepawn/jit/x86/jit_x86.cpp +++ b/sourcepawn/jit/x86/jit_x86.cpp @@ -1351,16 +1351,20 @@ inline void WriteOp_Call(JitWriter *jit) IA32_Add_Rm_Imm8(jit, REG_ESP, 8, MOD_REG); //call + //push eax jmp = IA32_Call_Imm32(jit, 0); IA32_Write_Jump32(jit, jmp, RelocLookup(jit, offs, false)); + IA32_Push_Reg(jit, REG_EAX); //push [esi+context] //call ProfCallGate_End //add esp, 4 + //pop eax IA32_Push_Rm_Disp8(jit, AMX_REG_INFO, AMX_INFO_CONTEXT); jmp = IA32_Call_Imm32(jit, 0); IA32_Write_Jump32_Abs(jit, jmp, (void *)ProfCallGate_End); IA32_Add_Rm_Imm8(jit, REG_ESP, 4, MOD_REG); + IA32_Pop_Reg(jit, REG_EAX); } else {