Skip to content

Commit d58e6b0

Browse files
authored
Cfg.can_raise_terminator: allocations no longer raise (#1439)
1 parent 84d9f67 commit d58e6b0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

backend/cfg/cfg.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,10 @@ let print_instruction ppf i = print_instruction' ppf i
413413
414414
let can_raise_terminator (i : terminator) =
415415
match i with
416-
| Raise _ | Tailcall_func _ | Call_no_return _ | Call _ | Prim _ -> true
416+
| Raise _ | Tailcall_func _ | Call_no_return _ | Call _
417+
| Prim { op = External _ | Checkbound _ | Probe _; label_after = _ } ->
418+
true
419+
| Prim { op = Alloc _; label_after = _ } -> false
417420
| Specific_can_raise { op; _ } ->
418421
assert (Arch.operation_can_raise op);
419422
true

0 commit comments

Comments
 (0)