mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4003 from ethereum/bool_vars_comparison
BREAKING: Bool variables should not allow arithmetic comparison
This commit is contained in:
@@ -472,11 +472,7 @@ void SMTChecker::compareOperation(BinaryOperation const& _op)
|
||||
solUnimplementedAssert(SSAVariable::isBool(_op.annotation().commonType->category()), "Operation not yet supported");
|
||||
value = make_shared<smt::Expression>(
|
||||
op == Token::Equal ? (left == right) :
|
||||
op == Token::NotEqual ? (left != right) :
|
||||
op == Token::LessThan ? (!left && right) :
|
||||
op == Token::LessThanOrEqual ? (!left || right) :
|
||||
op == Token::GreaterThan ? (left && !right) :
|
||||
/*op == Token::GreaterThanOrEqual*/ (left || !right)
|
||||
/*op == Token::NotEqual*/ (left != right)
|
||||
);
|
||||
}
|
||||
// TODO: check that other values for op are not possible.
|
||||
|
||||
Reference in New Issue
Block a user