From 659d22a99f5ffbd7560ee4e64c5b0d110c7db0ae Mon Sep 17 00:00:00 2001 From: Xinlong Hu Date: Fri, 1 Aug 2025 21:18:00 -0500 Subject: [PATCH] Prevent template from removing lines for CDG --- pylingual/control_flow_reconstruction/templates/Block.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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