diff --git a/pylingual/control_flow_reconstruction/templates/Block.py b/pylingual/control_flow_reconstruction/templates/Block.py index c93af82..18a6b8f 100644 --- a/pylingual/control_flow_reconstruction/templates/Block.py +++ b/pylingual/control_flow_reconstruction/templates/Block.py @@ -48,7 +48,7 @@ class RemoveUnreachable(ControlFlowTemplate): return None valid = list(nx.dfs_preorder_nodes(cfg, source=cfg.start)) - invalid = [n for n in cfg.nodes if n not in valid] + invalid = [n for n in cfg.nodes if n not in valid and has_no_lines(cfg, n)] if invalid: cfg.remove_nodes_from(invalid) return node