From dfc733c9e5d261411a74a82add97a0028876ebde Mon Sep 17 00:00:00 2001 From: Lex Bailey Date: Mon, 25 Nov 2024 17:23:52 +0000 Subject: [PATCH] bugfix: place_pi_functions now raises error when graph contains loop --- src/lib/jib_ssa.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/jib_ssa.ml b/src/lib/jib_ssa.ml index 757c0ad40..4ab64f03c 100644 --- a/src/lib/jib_ssa.ml +++ b/src/lib/jib_ssa.ml @@ -711,6 +711,7 @@ let place_pi_functions ~start ~finish ~post_idom ~post_df graph = if not (IntSet.mem n !visited) then ( match graph.nodes.(n) with | Some ((ssa, cfnode), preds, succs) -> + visited := IntSet.add n !visited; let disj = List.map (fun post_frontier -> @@ -740,7 +741,6 @@ let place_pi_functions ~start ~finish ~post_idom ~post_df graph = | [conj] -> Pi conj | conjs -> Pi [mk_disj (List.map (fun conj -> mk_conj conj) conjs)] in - visited := IntSet.add n !visited; graph.nodes.(n) <- Some ((mk_pi disj :: ssa, cfnode), preds, succs) | None -> () )