From 582162460fb10600d133166d9000c494301e3331 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 19 Aug 2013 12:59:10 -0700 Subject: [PATCH] Fix OP_MOVS to not clobber random memory (bug 5868, r=psychonic). --- sourcepawn/jit/x86/jit_x86.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sourcepawn/jit/x86/jit_x86.cpp b/sourcepawn/jit/x86/jit_x86.cpp index c3d22a40..8f9bf8f5 100644 --- a/sourcepawn/jit/x86/jit_x86.cpp +++ b/sourcepawn/jit/x86/jit_x86.cpp @@ -1020,8 +1020,9 @@ Compiler::emitOp(OPCODE op) __ cld(); __ push(esi); __ push(edi); - __ lea(esi, Operand(dat, pri, NoScale)); + // Note: set edi first, since we need esi. __ lea(edi, Operand(dat, alt, NoScale)); + __ lea(esi, Operand(dat, pri, NoScale)); if (dwords) { __ movl(ecx, dwords); __ rep_movsd();