diff options
author | Leonardo Alt <leo@ethereum.org> | 2018-04-27 17:35:58 +0800 |
---|---|---|
committer | Leonardo Alt <leo@ethereum.org> | 2018-04-27 17:35:58 +0800 |
commit | ab251c7e7d18a03184ab11e2d1c99d05af7d97f9 (patch) | |
tree | e9e9752d4163fe85dbdf6ff6ebb10d8b8e8eb187 /libsolidity/formal | |
parent | ef2111a2fe89fef06a4d8e750d6a652b16358f4b (diff) | |
download | dexon-solidity-ab251c7e7d18a03184ab11e2d1c99d05af7d97f9.tar dexon-solidity-ab251c7e7d18a03184ab11e2d1c99d05af7d97f9.tar.gz dexon-solidity-ab251c7e7d18a03184ab11e2d1c99d05af7d97f9.tar.bz2 dexon-solidity-ab251c7e7d18a03184ab11e2d1c99d05af7d97f9.tar.lz dexon-solidity-ab251c7e7d18a03184ab11e2d1c99d05af7d97f9.tar.xz dexon-solidity-ab251c7e7d18a03184ab11e2d1c99d05af7d97f9.tar.zst dexon-solidity-ab251c7e7d18a03184ab11e2d1c99d05af7d97f9.zip |
Bool variables should not allow arithmetic comparison
Diffstat (limited to 'libsolidity/formal')
-rw-r--r-- | libsolidity/formal/SMTChecker.cpp | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/libsolidity/formal/SMTChecker.cpp b/libsolidity/formal/SMTChecker.cpp index c4dee22d..7facdf92 100644 --- a/libsolidity/formal/SMTChecker.cpp +++ b/libsolidity/formal/SMTChecker.cpp @@ -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. |