Skip to content

Commit

Permalink
Partial application fix
Browse files Browse the repository at this point in the history
  • Loading branch information
vouillon committed May 21, 2024
1 parent ef48ae6 commit 3e586e3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions compiler/lib/wasm/wa_generate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ module Generate (Target : Wa_target_sig.S) = struct
match kind, funct with
| `Index, W.ConstSym (V g, 0) | `Ref _, W.RefFunc g ->
(* Functions with constant closures ignore their
environment *)
let* unit = Value.unit in
return (W.Call (g, List.rev (unit :: acc)))
environment. In case of partial application, we
still need the closure. *)
let* cl = if exact then Value.unit else return closure in
return (W.Call (g, List.rev (cl :: acc)))
| `Index, _ ->
return
(W.Call_indirect
Expand Down

0 comments on commit 3e586e3

Please sign in to comment.