Skip to content

Commit

Permalink
do not create tuple of arity less than two
Browse files Browse the repository at this point in the history
  • Loading branch information
zapashcanon committed Oct 7, 2024
1 parent 3df8f1f commit 86f0b40
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion wasm/wat.ml
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,12 @@ module C = struct
| Rvar v -> reft v
| Tuple l -> node "tuple" (List.map type_atom l)

let tuple_make fields = node "tuple.make" (Atom (List.length fields |> string_of_int) :: fields )
let tuple_make fields =
match fields with
| [] -> assert false
| [ field ] -> field
| fields ->
node "tuple.make" (Atom (List.length fields |> string_of_int) :: fields )

let local l t = node "local" [ !$(Expr.Local.var_name l); type_atom t ]

Expand Down

0 comments on commit 86f0b40

Please sign in to comment.