aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/formal
diff options
context:
space:
mode:
authorLeonardo Alt <leo@ethereum.org>2018-04-27 17:35:58 +0800
committerchriseth <chris@ethereum.org>2018-05-17 00:32:47 +0800
commit0b6eea0c557d0c987baa2d560fe3871ba3bb4a58 (patch)
tree78cea0e0f073e47f6b9c2eb81f434e463985f68b /libsolidity/formal
parent970567826905c953134e54c64f129e31b3fc6a05 (diff)
downloaddexon-solidity-0b6eea0c557d0c987baa2d560fe3871ba3bb4a58.tar.gz
dexon-solidity-0b6eea0c557d0c987baa2d560fe3871ba3bb4a58.tar.zst
dexon-solidity-0b6eea0c557d0c987baa2d560fe3871ba3bb4a58.zip
Bool variables should not allow arithmetic comparison
Diffstat (limited to 'libsolidity/formal')
-rw-r--r--libsolidity/formal/SMTChecker.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/libsolidity/formal/SMTChecker.cpp b/libsolidity/formal/SMTChecker.cpp
index 425c5c1e..8639317b 100644
--- a/libsolidity/formal/SMTChecker.cpp
+++ b/libsolidity/formal/SMTChecker.cpp
@@ -485,11 +485,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.