[SMTChecker] Fix ICE in fixed point operations

This commit is contained in:
Leonardo Alt 2019-04-30 17:45:28 +02:00
parent 73484ccaf2
commit 66655b87b0
2 changed files with 29 additions and 18 deletions

View File

@ -10,6 +10,7 @@ Compiler Features:
Bugfixes: Bugfixes:
* SMTChecker: Fix bad cast in base constructor modifier. * SMTChecker: Fix bad cast in base constructor modifier.
* SMTChecker: Fix internal error when visiting state variable inherited from base class. * SMTChecker: Fix internal error when visiting state variable inherited from base class.
* SMTChecker: Fix internal error in fixed point operations.

View File

@ -1049,6 +1049,10 @@ bool SMTChecker::shortcutRationalNumber(Expression const& _expr)
} }
void SMTChecker::arithmeticOperation(BinaryOperation const& _op) void SMTChecker::arithmeticOperation(BinaryOperation const& _op)
{
auto type = _op.annotation().commonType;
solAssert(type, "");
if (type->category() == Type::Category::Integer)
{ {
switch (_op.getOperator()) switch (_op.getOperator())
{ {
@ -1074,6 +1078,12 @@ void SMTChecker::arithmeticOperation(BinaryOperation const& _op)
); );
} }
} }
else
m_errorReporter.warning(
_op.location(),
"Assertion checker does not yet implement this operator for type " + type->richIdentifier() + "."
);
}
smt::Expression SMTChecker::arithmeticOperation( smt::Expression SMTChecker::arithmeticOperation(
Token _op, Token _op,