Fix crash on Windows
authorSimon Hausmann <simon.hausmann@digia.com>
Mon, 29 Apr 2013 09:44:03 +0000 (11:44 +0200)
committerLars Knoll <lars.knoll@digia.com>
Mon, 29 Apr 2013 10:24:59 +0000 (12:24 +0200)
Follow-up to commit 67b09aef34ff7997808e04194cdb92273ec76f14 about changing
the masm back-end to support returning the VM::Value in eax:edx instead
of through an invisible first pointer parameter: If the address of where
to store the return value is passed on the stack, it is the callee's
responsibility to take that one off the stack. We do that by emulating the
ret(n) instruction. However on Windows we don't want to do that because
we use the eax:edx register pair, so the correct #ifdef to use here is
RETURN_VALUE_IN_REGISTER, not ARGUMENTS_IN_REGISTERS.

Change-Id: I73ebd0688870348ed65ef91d7f2d73d0ba3ec542
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/qml/v4vm/qv4isel_masm.cpp

index db071c1..b2016b2 100644 (file)
@@ -576,7 +576,7 @@ void InstructionSelection::run(QV4::Function *vmFunction, V4IR::Function *functi
     }
 
     _as->leaveStandardStackFrame(locals);
-#ifndef ARGUMENTS_IN_REGISTERS
+#if !defined(RETURN_VALUE_IN_REGISTER)
     // Emulate ret(n) instruction
     // Pop off return address into scratch register ...
     _as->pop(Assembler::ScratchRegister);