- Fixed: FxCompareEq::Emit() needs to allocate the output register before freeing the inputs.

SVN r3906 (scripting)
This commit is contained in:
Randy Heit 2012-10-25 03:56:09 +00:00
parent 79228e4331
commit 5c6bf0aeb4

View file

@ -1719,6 +1719,8 @@ ExpEmit FxCompareEq::Emit(VMFunctionBuilder *build)
} }
assert(!op1.Konst); assert(!op1.Konst);
ExpEmit to(build, op1.RegType);
instr = op1.RegType == REGT_INT ? OP_EQ_R : instr = op1.RegType == REGT_INT ? OP_EQ_R :
op1.RegType == REGT_FLOAT ? OP_EQF_R : op1.RegType == REGT_FLOAT ? OP_EQF_R :
OP_EQA_R; OP_EQA_R;
@ -1731,7 +1733,6 @@ ExpEmit FxCompareEq::Emit(VMFunctionBuilder *build)
{ {
instr += 1; instr += 1;
} }
ExpEmit to(build, op1.RegType);
// See FxUnaryNotBoolean for comments, since it's the same thing. // See FxUnaryNotBoolean for comments, since it's the same thing.
build->Emit(OP_LI, to.RegNum, 0, 0); build->Emit(OP_LI, to.RegNum, 0, 0);