[yul] Ensures DataFlowAnalyzer works fine with break/continue statements just like without.

This commit is contained in:
Christian Parpart
2019-03-14 16:18:45 +01:00
committed by Christian Parpart
parent 94cd81de8c
commit 57bcb8ba83
7 changed files with 188 additions and 13 deletions
+5 -11
View File
@@ -117,6 +117,9 @@ void DataFlowAnalyzer::operator()(ForLoop& _for)
for (auto& statement: _for.pre.statements)
visit(statement);
AssignmentsSinceContinue assignmentsSinceCont;
assignmentsSinceCont(_for.body);
Assignments assignments;
assignments(_for.body);
assignments(_for.post);
@@ -124,22 +127,13 @@ void DataFlowAnalyzer::operator()(ForLoop& _for)
visit(*_for.condition);
(*this)(_for.body);
clearValues(assignmentsSinceCont.names());
(*this)(_for.post);
clearValues(assignments.names());
popScope();
}
void DataFlowAnalyzer::operator()(Break&)
{
yulAssert(false, "Not implemented yet.");
}
void DataFlowAnalyzer::operator()(Continue&)
{
yulAssert(false, "Not implemented yet.");
}
void DataFlowAnalyzer::operator()(Block& _block)
{
size_t numScopes = m_variableScopes.size();