For loops analysis.

This commit is contained in:
chriseth
2017-06-16 10:56:21 +01:00
committed by Alex Beregszaszi
parent 47925bc14e
commit 49b1112117
2 changed files with 41 additions and 4 deletions
+17 -2
View File
@@ -111,9 +111,24 @@ bool ScopeFiller::operator()(Switch const& _switch)
return success;
}
bool ScopeFiller::operator()(ForLoop const&)
bool ScopeFiller::operator()(ForLoop const& _forLoop)
{
solAssert(false, "For loop not supported.");
Scope* originalScope = m_currentScope;
bool success = true;
if (!(*this)(_forLoop.pre))
success = false;
m_currentScope = &scope(&_forLoop.pre);
if (!boost::apply_visitor(*this, *_forLoop.condition))
success = false;
if (!(*this)(_forLoop.body))
success = false;
if (!(*this)(_forLoop.post))
success = false;
m_currentScope = originalScope;
return success;
}
bool ScopeFiller::operator()(Block const& _block)