diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-20 01:33:25 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-05-26 10:20:31 +0800 |
commit | ba8a79c600e45618a5cd0bbfc044edbeab1e551c (patch) | |
tree | 64a4812dacc30f2df444bfeda7fff443244ad82c | |
parent | e48e84ca2bfdf863a798c88c329796284b2a87cb (diff) | |
download | dexon-solidity-ba8a79c600e45618a5cd0bbfc044edbeab1e551c.tar dexon-solidity-ba8a79c600e45618a5cd0bbfc044edbeab1e551c.tar.gz dexon-solidity-ba8a79c600e45618a5cd0bbfc044edbeab1e551c.tar.bz2 dexon-solidity-ba8a79c600e45618a5cd0bbfc044edbeab1e551c.tar.lz dexon-solidity-ba8a79c600e45618a5cd0bbfc044edbeab1e551c.tar.xz dexon-solidity-ba8a79c600e45618a5cd0bbfc044edbeab1e551c.tar.zst dexon-solidity-ba8a79c600e45618a5cd0bbfc044edbeab1e551c.zip |
Do not stop on first switch error
-rw-r--r-- | libsolidity/inlineasm/AsmAnalysis.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libsolidity/inlineasm/AsmAnalysis.cpp b/libsolidity/inlineasm/AsmAnalysis.cpp index a83a93a8..d022ecf6 100644 --- a/libsolidity/inlineasm/AsmAnalysis.cpp +++ b/libsolidity/inlineasm/AsmAnalysis.cpp @@ -287,9 +287,11 @@ bool AsmAnalyzer::operator()(assembly::FunctionCall const& _funCall) bool AsmAnalyzer::operator()(Switch const& _switch) { + bool success = true; + int const initialStackHeight = m_stackHeight; if (!boost::apply_visitor(*this, *_switch.expression)) - return false; + success = false; expectDeposit(1, initialStackHeight, locationOf(*_switch.expression)); set<tuple<LiteralKind, string>> cases; @@ -299,7 +301,7 @@ bool AsmAnalyzer::operator()(Switch const& _switch) { int const initialStackHeight = m_stackHeight; if (!(*this)(*_case.value)) - return false; + success = false; expectDeposit(1, initialStackHeight, _case.value->location); m_stackHeight--; @@ -312,17 +314,17 @@ bool AsmAnalyzer::operator()(Switch const& _switch) "Duplicate case defined", _case.location )); - return false; + success = false; } } if (!(*this)(_case.body)) - return false; + success = false; } m_stackHeight--; - return true; + return success; } bool AsmAnalyzer::operator()(Block const& _block) |