- unary minus operator propagates boolean operand to integer

https://forum.zdoom.org/viewtopic.php?t=63214
This commit is contained in:
alexey.lysiuk 2019-01-10 13:05:35 +02:00
parent d64dac9081
commit 5e5f27d756

View file

@ -1881,6 +1881,12 @@ FxExpression *FxMinusSign::Resolve(FCompileContext& ctx)
delete this;
return e;
}
else if (Operand->ValueType == TypeBool)
{
Operand = new FxIntCast(Operand, true);
Operand = Operand->Resolve(ctx);
assert(Operand != nullptr);
}
ValueType = Operand->ValueType;
return this;
}