Skip to content

Commit 70f8e86

Browse files
committed
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
1 parent 593f825 commit 70f8e86

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

chb/app/Cfg.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,6 @@ def stmt_ast(
477477
fn = astfn.function
478478

479479
def mk_block(stmts: List[AST.ASTStmt]) -> AST.ASTStmt:
480-
if len(stmts) == 1 and not stmts[0].is_ast_instruction_sequence:
481-
return stmts[0]
482480
return astree.mk_block(stmts)
483481

484482
gotolabels: Set[str] = set() # this is both used and mutated by run_with_gotolabels()

0 commit comments

Comments
 (0)