Merge pull request #7171 from ethereum/smt_fix_compound_bitwise

[SMTChecker] Fix ICE compound bitwise op inside branch
This commit is contained in:
Leonardo
2019-08-05 12:15:01 +02:00
committed by GitHub
7 changed files with 78 additions and 0 deletions
+12
View File
@@ -214,10 +214,16 @@ void SMTEncoder::endVisit(Assignment const& _assignment)
};
Token op = _assignment.assignmentOperator();
if (op != Token::Assign && !compoundOps.count(op))
{
// Give it a new index anyway to keep the SSA scheme sound.
if (auto varDecl = identifierToVariable(_assignment.leftHandSide()))
m_context.newValue(*varDecl);
m_errorReporter.warning(
_assignment.location(),
"Assertion checker does not yet implement this assignment operator."
);
}
else if (!smt::isSupportedType(_assignment.annotation().type->category()))
{
// Give it a new index anyway to keep the SSA scheme sound.
@@ -1031,10 +1037,16 @@ void SMTEncoder::assignment(
)
{
if (!smt::isSupportedType(_type->category()))
{
// Give it a new index anyway to keep the SSA scheme sound.
if (auto varDecl = identifierToVariable(_left))
m_context.newValue(*varDecl);
m_errorReporter.warning(
_location,
"Assertion checker does not yet implement type " + _type->toString()
);
}
else if (auto varDecl = identifierToVariable(_left))
{
solAssert(_right.size() == 1, "");