- Fixed: FxCompareRel::Emit() needs to allocate the output register before freeing either of

the operands.

SVN r3903 (scripting)
This commit is contained in:
Randy Heit 2012-10-23 03:19:26 +00:00
parent d0c91083bc
commit 0dae6527ad

View file

@ -1569,6 +1569,7 @@ ExpEmit FxCompareRel::Emit(VMFunctionBuilder *build)
{ OP_LE_RR, OP_LEF_RR, 0 } // <= { OP_LE_RR, OP_LEF_RR, 0 } // <=
}; };
int instr, check, index; int instr, check, index;
ExpEmit to(build, REGT_INT);
index = Operator == '<' ? 0 : index = Operator == '<' ? 0 :
Operator == '>' ? 1 : Operator == '>' ? 1 :
@ -1591,7 +1592,6 @@ ExpEmit FxCompareRel::Emit(VMFunctionBuilder *build)
{ {
op1.Free(build); op1.Free(build);
} }
ExpEmit to(build, REGT_INT);
// 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);