From 70f8e8624cf1aa60b96b81947b91b3599047c3fd Mon Sep 17 00:00:00 2001 From: Ricardo Baratto Date: Thu, 21 Aug 2025 16:21:12 -0400 Subject: [PATCH] CFG: always create a block even if it only has a single statement We want to be consistent and predictable, and avoid issues with CIL which normalizes statements into blocks within if/else, switch, and loops. This also enables simplification for downstream tools --- chb/app/Cfg.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/chb/app/Cfg.py b/chb/app/Cfg.py index 09ba1d47..451db56b 100644 --- a/chb/app/Cfg.py +++ b/chb/app/Cfg.py @@ -477,8 +477,6 @@ def stmt_ast( fn = astfn.function def mk_block(stmts: List[AST.ASTStmt]) -> AST.ASTStmt: - if len(stmts) == 1 and not stmts[0].is_ast_instruction_sequence: - return stmts[0] return astree.mk_block(stmts) gotolabels: Set[str] = set() # this is both used and mutated by run_with_gotolabels()