From 2d8ad06cf5c956dcbacc35ffe7f0e7f96b5b4b24 Mon Sep 17 00:00:00 2001 From: Douglas Wilson Date: Thu, 18 Jan 2024 10:40:33 +0000 Subject: [PATCH] fix: correct order of basic block successors --- guppylang/cfg/builder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guppylang/cfg/builder.py b/guppylang/cfg/builder.py index b99c2a7d..1a2490da 100644 --- a/guppylang/cfg/builder.py +++ b/guppylang/cfg/builder.py @@ -459,8 +459,8 @@ def generic_visit(self, node: ast.expr, bb: BB, true_bb: BB, false_bb: BB) -> No # the result as a branch predicate pred, bb = ExprBuilder.build(node, self.cfg, bb) bb.branch_pred = pred - self.cfg.link(bb, true_bb) self.cfg.link(bb, false_bb) + self.cfg.link(bb, true_bb) def is_functional_annotation(stmt: ast.stmt) -> bool: