File tree 2 files changed +23
-0
lines changed
2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -749,6 +749,14 @@ let rec choice ctx t =
749
749
| other -> other
750
750
in
751
751
{ apply with ap_tailcall } in
752
+ (* The call will not be in tail position, so the close-on-apply flag must
753
+ not be set. *)
754
+ let ap_region_close =
755
+ match apply.ap_region_close with
756
+ | Rc_close_at_apply -> Rc_normal
757
+ | (Rc_normal | Rc_nontail ) as reg_close -> reg_close
758
+ in
759
+ let apply = { apply with ap_region_close } in
752
760
{ (Choice. lambda (Lapply apply)) with
753
761
direct = (fun () -> Lapply apply_no_bailout);
754
762
}
Original file line number Diff line number Diff line change
1
+ (* TEST
2
+ * bytecode
3
+ * native
4
+ *)
5
+
6
+ (* This was producing an error in ocamlopt because the call to [failwith] had
7
+ the close-at-apply flag on, which wasn't cleared when tmc rewrote the call to
8
+ one not in tail position. *)
9
+
10
+ let [@ tail_mod_cons] rec map2_exn l0 l1 ~f =
11
+ match l0, l1 with
12
+ | [] , [] -> []
13
+ | h0 :: t0 , h1 :: t1 -> f h0 h1 :: map2_exn t0 t1 ~f
14
+ | _ -> failwith (let message () = " urk" in message () )
15
+ ;;
You can’t perform that action at this time.
0 commit comments