Skip to content

Commit

Permalink
Test binary parser parses declarative element segment with init as …
Browse files Browse the repository at this point in the history
…`vec(expr)`

This commit adds a binary for `wasm-dis` that is generated from the
following WAT file with a reference-interpreter from the `wasm-3.0+exn` branch:
WebAssembly/spec@b16745e

```wat
(module
  (elem declare funcref (item ref.func $f))
  (func $f (block
    (ref.func $f)
    (drop)
  ))
)
```

The generated `.fromBinary` contains `(elem declare func $f)` instead
of `(elem declare funcref (item ref.func $f))` because the parser
doesn't preserve declarative segments. This is fine, as we test that
the binary parser can parse the declarative element segment whose
`init` is `vec(expr)` without trapping.
  • Loading branch information
tanishiking committed May 31, 2024
1 parent bd7db20 commit 36bb145
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
Binary file added test/declarative-element-use-expr.wasm
Binary file not shown.
11 changes: 11 additions & 0 deletions test/declarative-element-use-expr.wasm.fromBinary
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(module
(type $0 (func))
(func $0
(block $label$1
(drop
(ref.func $0)
)
)
)
)

0 comments on commit 36bb145

Please sign in to comment.