From 5c6bf0aeb4cc139d96442f9cc61f587911142003 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 25 Oct 2012 03:56:09 +0000 Subject: [PATCH] - Fixed: FxCompareEq::Emit() needs to allocate the output register before freeing the inputs. SVN r3906 (scripting) --- src/thingdef/thingdef_expression.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/thingdef/thingdef_expression.cpp b/src/thingdef/thingdef_expression.cpp index 2282949fec..671bb55a87 100644 --- a/src/thingdef/thingdef_expression.cpp +++ b/src/thingdef/thingdef_expression.cpp @@ -1719,6 +1719,8 @@ ExpEmit FxCompareEq::Emit(VMFunctionBuilder *build) } assert(!op1.Konst); + ExpEmit to(build, op1.RegType); + instr = op1.RegType == REGT_INT ? OP_EQ_R : op1.RegType == REGT_FLOAT ? OP_EQF_R : OP_EQA_R; @@ -1731,7 +1733,6 @@ ExpEmit FxCompareEq::Emit(VMFunctionBuilder *build) { instr += 1; } - ExpEmit to(build, op1.RegType); // See FxUnaryNotBoolean for comments, since it's the same thing. build->Emit(OP_LI, to.RegNum, 0, 0);