Skip to content

Commit

Permalink
Fix recursive calls in local functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tjammer committed Oct 2, 2024
1 parent d3a9773 commit fa0df40
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/monomorph_tree.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,11 @@ and morph_app mk p callee args ret_typ =

let app = Mapp { callee; args; alloca = alloc_ref; id; ms } in

({ p with ret; mallocs }, mk app ret, { no_var with alloc; malloc; tailrec })
(* We use tailrec here because the return state is only use for tailrec
detection in codegen. Ideally, we would set this more explicitly. *)
( { p with ret; mallocs },
mk app tailrec,
{ no_var with alloc; malloc; tailrec } )

and morph_ctor mk p variant index expr typ =
let ret = p.ret in
Expand Down

0 comments on commit fa0df40

Please sign in to comment.