diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-07-25 06:23:54 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-07-25 06:23:54 +0800 |
commit | d30a6de94287a4bd34b4cec09d60018f1bff083c (patch) | |
tree | a8639537d9cff9e8b1443b5094941b3441354ac2 /libsolidity/formal/SMTChecker.cpp | |
parent | 278372c13d611b829fbad6984a0a3951f0a11d99 (diff) | |
download | dexon-solidity-d30a6de94287a4bd34b4cec09d60018f1bff083c.tar dexon-solidity-d30a6de94287a4bd34b4cec09d60018f1bff083c.tar.gz dexon-solidity-d30a6de94287a4bd34b4cec09d60018f1bff083c.tar.bz2 dexon-solidity-d30a6de94287a4bd34b4cec09d60018f1bff083c.tar.lz dexon-solidity-d30a6de94287a4bd34b4cec09d60018f1bff083c.tar.xz dexon-solidity-d30a6de94287a4bd34b4cec09d60018f1bff083c.tar.zst dexon-solidity-d30a6de94287a4bd34b4cec09d60018f1bff083c.zip |
Add better warning on binary operation on non-integer types in SMT Checker
Diffstat (limited to 'libsolidity/formal/SMTChecker.cpp')
-rw-r--r-- | libsolidity/formal/SMTChecker.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libsolidity/formal/SMTChecker.cpp b/libsolidity/formal/SMTChecker.cpp index c992fd61..2623a2ba 100644 --- a/libsolidity/formal/SMTChecker.cpp +++ b/libsolidity/formal/SMTChecker.cpp @@ -429,7 +429,14 @@ void SMTChecker::arithmeticOperation(BinaryOperation const& _op) case Token::Div: { solAssert(_op.annotation().commonType, ""); - solAssert(_op.annotation().commonType->category() == Type::Category::Integer, ""); + if (_op.annotation().commonType->category() != Type::Category::Integer) + { + m_errorReporter.warning( + _op.location(), + "Assertion checker does not yet implement this operator on non-integer types." + ); + break; + } auto const& intType = dynamic_cast<IntegerType const&>(*_op.annotation().commonType); smt::Expression left(expr(_op.leftExpression())); smt::Expression right(expr(_op.rightExpression())); |