Skip to content

Commit

Permalink
Fix ref i31 casting/creation
Browse files Browse the repository at this point in the history
  • Loading branch information
chambart committed Oct 7, 2024
1 parent 86f0b40 commit f43a2a8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wasm/emit_wat.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2053,12 +2053,12 @@ module ToWasm = struct
let conv_unop (op : Expr.unop) arg =
match op with
| I31_get_s -> Cst.node "i31.get_s" [ arg ]
| I31_new -> Cst.node "i31.new" [ arg ]
| I31_new -> Cst.node "ref.i31" [ arg ]
| Struct_get { typ; field } -> C.struct_get typ field arg
| Struct_get_packed { typ; field; extend } ->
C.struct_get_packed extend typ field arg
| Ref_cast_i31 -> Cst.node "ref.cast" [ Cst.atom "i31"; arg ]
| Is_i31 -> Cst.node "ref.test" [ Cst.atom "i31"; arg ]
| Ref_cast_i31 -> Cst.node "ref.cast" [ Cst.node "ref" [Cst.atom "i31"]; arg ]
| Is_i31 -> Cst.node "ref.test" [ Cst.node "ref" [Cst.atom "i31"]; arg ]
| Array_len t -> C.array_len t arg
| Reinterpret { from_type; to_type } ->
let name =
Expand Down

0 comments on commit f43a2a8

Please sign in to comment.