mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Remove `leave` at end of function.
This commit is contained in:
@@ -136,6 +136,13 @@ void ControlFlowSimplifier::operator()(Block& _block)
|
||||
simplify(_block.statements);
|
||||
}
|
||||
|
||||
void ControlFlowSimplifier::operator()(FunctionDefinition& _funDef)
|
||||
{
|
||||
ASTModifier::operator()(_funDef);
|
||||
if (!_funDef.body.statements.empty() && _funDef.body.statements.back().type() == typeid(Leave))
|
||||
_funDef.body.statements.pop_back();
|
||||
}
|
||||
|
||||
void ControlFlowSimplifier::visit(Statement& _st)
|
||||
{
|
||||
if (_st.type() == typeid(ForLoop))
|
||||
|
||||
Reference in New Issue
Block a user