- fixed: FxUnaryNotBitwise modified the source operand instead of allocating a new one.

This commit is contained in:
Christoph Oelckers 2018-11-16 11:21:51 +01:00
parent 1250eb5323
commit 7cd89fe07b

View file

@ -2058,10 +2058,12 @@ ExpEmit FxUnaryNotBitwise::Emit(VMFunctionBuilder *build)
{ {
assert(Operand->ValueType->GetRegType() == REGT_INT); assert(Operand->ValueType->GetRegType() == REGT_INT);
ExpEmit from = Operand->Emit(build); ExpEmit from = Operand->Emit(build);
from.Free(build);
ExpEmit to(build, REGT_INT);
assert(!from.Konst); assert(!from.Konst);
// Do it in-place.
build->Emit(OP_NOT, from.RegNum, from.RegNum, 0); build->Emit(OP_NOT, to.RegNum, from.RegNum, 0);
return from; return to;
} }
//========================================================================== //==========================================================================