mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
For loops analysis.
This commit is contained in:
committed by
Alex Beregszaszi
parent
47925bc14e
commit
49b1112117
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user