diff options
author | chriseth <chris@ethereum.org> | 2017-06-01 20:16:12 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-06-16 17:56:21 +0800 |
commit | 49b11121179040d438dd8795a710f3d9de3de789 (patch) | |
tree | 846a73ba149b2ba4e9f855170da1e4d99f45c518 /libsolidity/inlineasm/AsmScopeFiller.cpp | |
parent | 47925bc14e80d0c33c491dabc3c3dd3ea787b63c (diff) | |
download | dexon-solidity-49b11121179040d438dd8795a710f3d9de3de789.tar.gz dexon-solidity-49b11121179040d438dd8795a710f3d9de3de789.tar.zst dexon-solidity-49b11121179040d438dd8795a710f3d9de3de789.zip |
For loops analysis.
Diffstat (limited to 'libsolidity/inlineasm/AsmScopeFiller.cpp')
-rw-r--r-- | libsolidity/inlineasm/AsmScopeFiller.cpp | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/libsolidity/inlineasm/AsmScopeFiller.cpp b/libsolidity/inlineasm/AsmScopeFiller.cpp index 1aac902a..3bef9cec 100644 --- a/libsolidity/inlineasm/AsmScopeFiller.cpp +++ b/libsolidity/inlineasm/AsmScopeFiller.cpp @@ -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) |