diff options
author | chriseth <chris@ethereum.org> | 2018-05-02 21:56:59 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-02 21:56:59 +0800 |
commit | 8debded7431cb852bd66edc8ebb615cb39f95231 (patch) | |
tree | 8cd4db92d6d7b5aa7c31995ff9a5026c4e9312a3 /libsolidity/formal | |
parent | 42289b642ff12d9275dedf10c257cfec8295feed (diff) | |
download | dexon-solidity-8debded7431cb852bd66edc8ebb615cb39f95231.tar.gz dexon-solidity-8debded7431cb852bd66edc8ebb615cb39f95231.tar.zst dexon-solidity-8debded7431cb852bd66edc8ebb615cb39f95231.zip |
Revert "BREAKING: Bool variables should not allow arithmetic comparison"
Diffstat (limited to 'libsolidity/formal')
-rw-r--r-- | libsolidity/formal/SMTChecker.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libsolidity/formal/SMTChecker.cpp b/libsolidity/formal/SMTChecker.cpp index 7facdf92..c4dee22d 100644 --- a/libsolidity/formal/SMTChecker.cpp +++ b/libsolidity/formal/SMTChecker.cpp @@ -472,7 +472,11 @@ 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::NotEqual ? (left != right) : + op == Token::LessThan ? (!left && right) : + op == Token::LessThanOrEqual ? (!left || right) : + op == Token::GreaterThan ? (left && !right) : + /*op == Token::GreaterThanOrEqual*/ (left || !right) ); } // TODO: check that other values for op are not possible. |