Don't use xor operator for boolean operations

This commit is contained in:
Tim Wojtulewicz 2020-03-24 13:11:26 -07:00
parent 10f0fffe29
commit 7ec96f25ac

View file

@ -2053,7 +2053,8 @@ bool AssignExpr::TypeCheck(attr_list* attrs)
// the script level.
return true;
if ( ((bt1 == TYPE_ENUM) ^ (bt2 == TYPE_ENUM)) )
// This should be one of them, but not both (i.e. XOR)
if ( (bt1 == TYPE_ENUM) == ! (bt2 == TYPE_ENUM) )
{
ExprError("can't convert to/from enumerated type");
return false;