diff options
Diffstat (limited to 'libsolidity/inlineasm')
-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) |