Skip to content

Commit 4197fcb

Browse files
committed
Compiler: add one assertion in the inlining pass
1 parent d0d5be2 commit 4197fcb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

compiler/lib/inline.ml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -612,9 +612,11 @@ and inline_function ~context i x f args rem state =
612612
context.live_vars.(Var.idx f) <- context.live_vars.(Var.idx f) - 1;
613613
let p, params, cont =
614614
if context.live_vars.(Var.idx f) > 0
615-
then
616-
let p, _, params, cont = Duplicate.closure p ~f ~params ~cont in
617-
p, params, cont
615+
then (
616+
let p, _f, params, cont = Duplicate.closure p ~f ~params ~cont in
617+
(* It's ok to ignore the [_f] because the function is not recursive *)
618+
assert (not info.recursive);
619+
p, params, cont)
618620
else p, params, cont
619621
in
620622
let p = inline_recursively ~context ~info p params cont args in

0 commit comments

Comments
 (0)