[SMTChecker] Fix ICE when inlining function with tuple expression

This commit is contained in:
Leonardo Alt
2019-07-26 16:29:29 +02:00
parent 4f7fec6911
commit 847f574e22
3 changed files with 34 additions and 16 deletions
+19 -16
View File
@@ -266,24 +266,27 @@ void SMTEncoder::endVisit(TupleExpression const& _tuple)
);
else if (_tuple.annotation().type->category() == Type::Category::Tuple)
{
vector<shared_ptr<smt::SymbolicVariable>> components;
for (auto const& component: _tuple.components())
if (component)
{
if (auto varDecl = identifierToVariable(*component))
components.push_back(m_context.variable(*varDecl));
else
{
solAssert(m_context.knownExpression(*component), "");
components.push_back(m_context.expression(*component));
}
}
else
components.push_back(nullptr);
solAssert(components.size() == _tuple.components().size(), "");
auto const& symbTuple = dynamic_pointer_cast<smt::SymbolicTupleVariable>(m_context.expression(_tuple));
solAssert(symbTuple, "");
symbTuple->setComponents(move(components));
if (symbTuple->components().empty())
{
vector<shared_ptr<smt::SymbolicVariable>> components;
for (auto const& component: _tuple.components())
if (component)
{
if (auto varDecl = identifierToVariable(*component))
components.push_back(m_context.variable(*varDecl));
else
{
solAssert(m_context.knownExpression(*component), "");
components.push_back(m_context.expression(*component));
}
}
else
components.push_back(nullptr);
solAssert(components.size() == _tuple.components().size(), "");
symbTuple->setComponents(move(components));
}
}
else
{