[SMTChecker] Fix ICE on array.pop nested inside 1-tuple

This commit is contained in:
Martin Blicha
2021-03-09 20:00:51 +01:00
parent ad5d34df74
commit 4285c2803b
5 changed files with 16 additions and 4 deletions
+1 -1
View File
@@ -774,7 +774,7 @@ void CHC::makeArrayPopVerificationTarget(FunctionCall const& _arrayPop)
FunctionType const& funType = dynamic_cast<FunctionType const&>(*_arrayPop.expression().annotation().type);
solAssert(funType.kind() == FunctionType::Kind::ArrayPop, "");
auto memberAccess = dynamic_cast<MemberAccess const*>(&_arrayPop.expression());
auto memberAccess = dynamic_cast<MemberAccess const*>(cleanExpression(_arrayPop.expression()));
solAssert(memberAccess, "");
auto symbArray = dynamic_pointer_cast<SymbolicArrayVariable>(m_context.expression(memberAccess->expression()));
solAssert(symbArray, "");
+4 -1
View File
@@ -444,6 +444,9 @@ void SMTEncoder::endVisit(Assignment const& _assignment)
void SMTEncoder::endVisit(TupleExpression const& _tuple)
{
if (_tuple.annotation().type->category() == Type::Category::Function)
return;
createExpr(_tuple);
if (_tuple.isInlineArray())
@@ -1624,7 +1627,7 @@ void SMTEncoder::arrayPush(FunctionCall const& _funCall)
void SMTEncoder::arrayPop(FunctionCall const& _funCall)
{
auto memberAccess = dynamic_cast<MemberAccess const*>(&_funCall.expression());
auto memberAccess = dynamic_cast<MemberAccess const*>(cleanExpression(_funCall.expression()));
solAssert(memberAccess, "");
auto symbArray = dynamic_pointer_cast<smt::SymbolicArrayVariable>(m_context.expression(memberAccess->expression()));
solAssert(symbArray, "");