[SMTChecker] Fix ICE in array of structs type

This commit is contained in:
Leonardo Alt
2019-12-03 01:12:30 +01:00
parent 4d2f205706
commit b1577f5e46
8 changed files with 30 additions and 10 deletions
+5 -5
View File
@@ -869,8 +869,11 @@ void SMTEncoder::endVisit(IndexAccess const& _indexAccess)
{
createExpr(_indexAccess);
if (_indexAccess.annotation().type->category() == Type::Category::TypeType)
return;
shared_ptr<smt::SymbolicVariable> array;
if (auto const& id = dynamic_cast<Identifier const*>(&_indexAccess.baseExpression()))
if (auto const* id = dynamic_cast<Identifier const*>(&_indexAccess.baseExpression()))
{
auto varDecl = identifierToVariable(*id);
solAssert(varDecl, "");
@@ -885,7 +888,7 @@ void SMTEncoder::endVisit(IndexAccess const& _indexAccess)
return;
}
}
else if (auto const& innerAccess = dynamic_cast<IndexAccess const*>(&_indexAccess.baseExpression()))
else if (auto const* innerAccess = dynamic_cast<IndexAccess const*>(&_indexAccess.baseExpression()))
{
solAssert(m_context.knownExpression(*innerAccess), "");
array = m_context.expression(*innerAccess);
@@ -899,9 +902,6 @@ void SMTEncoder::endVisit(IndexAccess const& _indexAccess)
return;
}
if (_indexAccess.annotation().type->category() == Type::Category::TypeType)
return;
solAssert(array, "");
defineExpr(_indexAccess, smt::Expression::select(
array->currentValue(),