Skip to content

Commit 95b68f0

Browse files
committed
[SQUASH] Assert special nodes are null.
1 parent dc4e951 commit 95b68f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libyul/ControlFlowSideEffectsCollector.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,7 @@ void ControlFlowBuilder::operator()(Switch const& _switch)
8080
void ControlFlowBuilder::operator()(FunctionDefinition const& _function)
8181
{
8282
ScopedSaveAndRestore currentNode(m_currentNode, nullptr);
83-
ScopedSaveAndRestore leaveNode(m_leave, nullptr);
84-
ScopedSaveAndRestore breakNode(m_break, nullptr);
85-
ScopedSaveAndRestore continueNode(m_continue, nullptr);
83+
yulAssert(!m_leave && !m_break && !m_continue, "Function hoister has not been used.");
8684

8785
FunctionFlow flow;
8886
flow.exit = newNode();
@@ -95,6 +93,8 @@ void ControlFlowBuilder::operator()(FunctionDefinition const& _function)
9593
m_currentNode->successors.emplace_back(flow.exit);
9694

9795
m_functionFlows[_function.name] = move(flow);
96+
97+
m_leave = nullptr;
9898
}
9999

100100
void ControlFlowBuilder::operator()(ForLoop const& _for)

0 commit comments

Comments
 (0)