Permalink
Browse files

- unary minus operator propagates boolean operand to integer

  • Loading branch information...
alexey-lysiuk authored and coelckers committed Jan 10, 2019
1 parent 2bb7d49 commit 2cd1ac49eb6e8b246d8c7907b45f104bbadb5c46
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/scripting/backend/codegen.cpp
@@ -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;
}

0 comments on commit 2cd1ac4

Please sign in to comment.