Commit 7e1483e9 authored by Vitja Makarov's avatar Vitja Makarov

If no parents don't make next block current

parent 2a0ee6a6
......@@ -741,7 +741,11 @@ class CreateControlFlowGraph(CythonTransform):
self.flow.block.add_child(next_block)
else:
condition_block.add_child(next_block)
self.flow.block = next_block
if next_block.parents:
self.flow.block = next_block
else:
self.flow.block = None
return node
def visit_ForInStatNode(self, node):
......@@ -768,7 +772,11 @@ class CreateControlFlowGraph(CythonTransform):
self.flow.block.add_child(next_block)
else:
condition_block.add_child(next_block)
self.flow.block = next_block
if next_block.parents:
self.flow.block = next_block
else:
self.flow.block = None
return node
def visit_ForFromStatNode(self, node):
......@@ -799,7 +807,11 @@ class CreateControlFlowGraph(CythonTransform):
self.flow.block.add_child(next_block)
else:
condition_block.add_child(next_block)
self.flow.block = next_block
if next_block.parents:
self.flow.block = next_block
else:
self.flow.block = None
return node
def visit_LoopNode(self, node):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment