From 1a77530c932dfe9bdaa6c432238ad87e5096146e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 16 May 2007 01:17:14 +0000 Subject: [PATCH] fixed a bug where the JIT initiated the optimized stack top boundary check with a doubly relocated address, causing a rare bug with stack operations --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40806 --- sourcepawn/jit/x86/opcode_helpers.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sourcepawn/jit/x86/opcode_helpers.cpp b/sourcepawn/jit/x86/opcode_helpers.cpp index 00fc3dd7..65d1d554 100644 --- a/sourcepawn/jit/x86/opcode_helpers.cpp +++ b/sourcepawn/jit/x86/opcode_helpers.cpp @@ -80,7 +80,7 @@ jitoffs_t Write_Execute_Function(JitWriter *jit) //mov ecx, [eax+] - copy memsize to temp var //add ecx, ebp - relocate //mov [esi+x], ecx - store relocated - IA32_Mov_Reg_Rm_Disp8(jit, REG_ECX, REG_EAX, offsetof(sp_context_t, memory)); + IA32_Mov_Reg_Rm_Disp8(jit, REG_ECX, REG_EAX, offsetof(sp_context_t, mem_size)); IA32_Add_Reg_Rm(jit, AMX_REG_TMP, AMX_REG_DAT, MOD_REG); IA32_Mov_Rm_Reg_Disp8(jit, AMX_REG_INFO, REG_ECX, AMX_INFO_STACKTOP);