@@ -1437,14 +1437,15 @@ and compile_block st queue (pc : Addr.t) frontier interm =
1437
1437
assert (Addr.Set. cardinal handler_frontier_cont < = 1 );
1438
1438
let try_catch_frontier = Addr.Set. union new_frontier handler_frontier_cont in
1439
1439
if debug () then Format. eprintf " @[<2>try {@," ;
1440
+ if Addr.Map. mem pc1 handler_interm then decr_preds st pc1;
1440
1441
let body =
1441
1442
prefix
1442
1443
@ compile_branch
1443
1444
st
1444
1445
[]
1445
1446
(pc1, args1)
1446
1447
None
1447
- Addr.Set. empty
1448
+ backs
1448
1449
try_catch_frontier
1449
1450
handler_interm
1450
1451
in
@@ -1454,7 +1455,10 @@ and compile_block st queue (pc : Addr.t) frontier interm =
1454
1455
let m = Subst. build_mapping args2 block2.params in
1455
1456
try Var.Map. find x m with Not_found -> x
1456
1457
in
1457
- let handler = compile_block st [] pc2 try_catch_frontier handler_interm in
1458
+ if Addr.Map. mem pc2 handler_interm then decr_preds st pc2;
1459
+ let handler =
1460
+ compile_branch st [] (pc2, args2) None backs try_catch_frontier handler_interm
1461
+ in
1458
1462
if debug () then Format. eprintf " }@]@ " ;
1459
1463
Addr.Set. iter (decr_preds st) handler_frontier;
1460
1464
@@ -1528,6 +1532,8 @@ and compile_block st queue (pc : Addr.t) frontier interm =
1528
1532
colapse_frontier st new_frontier interm
1529
1533
in
1530
1534
assert (Addr.Set. cardinal frontier_cont < = 1 );
1535
+ List. iter succs ~f: (fun (pc , _ ) ->
1536
+ if Addr.Map. mem pc new_interm then decr_preds st pc);
1531
1537
(* Beware evaluation order! *)
1532
1538
let cond =
1533
1539
compile_conditional
@@ -1616,7 +1622,7 @@ and colapse_frontier st new_frontier interm =
1616
1622
of the frontier. *)
1617
1623
Addr.Set. iter (fun pc -> incr_preds st pc) new_frontier;
1618
1624
(* Put a limit: we are going to remove other branches
1619
- to the members of the frontier (in compile_conditional ),
1625
+ to the members of the frontier (in compile_block ),
1620
1626
but they should remain in the frontier. *)
1621
1627
Addr.Set. iter (fun pc -> protect_preds st pc) new_frontier;
1622
1628
Hashtbl. add st.succs idx (Addr.Set. elements new_frontier);
@@ -1695,7 +1701,6 @@ and compile_decision_tree st _queue handler backs frontier interm succs loc cx d
1695
1701
binds @ snd (loop cx dtree)
1696
1702
1697
1703
and compile_conditional st queue pc last handler backs frontier interm succs =
1698
- List. iter succs ~f: (fun (pc , _ ) -> if Addr.Map. mem pc interm then decr_preds st pc);
1699
1704
(if debug ()
1700
1705
then
1701
1706
match last with
0 commit comments