mirror of
https://github.com/syssec-utd/pylingual.git
synced 2026-05-10 18:39:03 -07:00
Prevent template from removing lines for CDG
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user