mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Do not stop on first switch error
This commit is contained in:
parent
e48e84ca2b
commit
ba8a79c600
@ -287,9 +287,11 @@ bool AsmAnalyzer::operator()(assembly::FunctionCall const& _funCall)
|
|||||||
|
|
||||||
bool AsmAnalyzer::operator()(Switch const& _switch)
|
bool AsmAnalyzer::operator()(Switch const& _switch)
|
||||||
{
|
{
|
||||||
|
bool success = true;
|
||||||
|
|
||||||
int const initialStackHeight = m_stackHeight;
|
int const initialStackHeight = m_stackHeight;
|
||||||
if (!boost::apply_visitor(*this, *_switch.expression))
|
if (!boost::apply_visitor(*this, *_switch.expression))
|
||||||
return false;
|
success = false;
|
||||||
expectDeposit(1, initialStackHeight, locationOf(*_switch.expression));
|
expectDeposit(1, initialStackHeight, locationOf(*_switch.expression));
|
||||||
|
|
||||||
set<tuple<LiteralKind, string>> cases;
|
set<tuple<LiteralKind, string>> cases;
|
||||||
@ -299,7 +301,7 @@ bool AsmAnalyzer::operator()(Switch const& _switch)
|
|||||||
{
|
{
|
||||||
int const initialStackHeight = m_stackHeight;
|
int const initialStackHeight = m_stackHeight;
|
||||||
if (!(*this)(*_case.value))
|
if (!(*this)(*_case.value))
|
||||||
return false;
|
success = false;
|
||||||
expectDeposit(1, initialStackHeight, _case.value->location);
|
expectDeposit(1, initialStackHeight, _case.value->location);
|
||||||
m_stackHeight--;
|
m_stackHeight--;
|
||||||
|
|
||||||
@ -312,17 +314,17 @@ bool AsmAnalyzer::operator()(Switch const& _switch)
|
|||||||
"Duplicate case defined",
|
"Duplicate case defined",
|
||||||
_case.location
|
_case.location
|
||||||
));
|
));
|
||||||
return false;
|
success = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(*this)(_case.body))
|
if (!(*this)(_case.body))
|
||||||
return false;
|
success = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_stackHeight--;
|
m_stackHeight--;
|
||||||
|
|
||||||
return true;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AsmAnalyzer::operator()(Block const& _block)
|
bool AsmAnalyzer::operator()(Block const& _block)
|
||||||
|
Loading…
Reference in New Issue
Block a user