-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wasmparser
: Valid Wasm is not accepted if bulk-memory
is enabled and reference-types
is disabled
#889
Comments
wasmparser
improperly fails with reference types support is not enabled
wasmparser
improperly fails with: reference types support is not enabled
The bulk memory and reference types proposals were heavily intertwined and very little care was given at the time when implementing them in wasmparser as to which precise feature went where, so I'm sure mistakes were made or the spec has drifted since. It's fine to recategorize features under different proposals retroactively. |
What does this mean with respect to this issue? The Fixing this issue in |
wasmparser
improperly fails with: reference types support is not enabled
wasmparser
incorrectly fails with: reference types support is not enabled
I'm not entirely sure unfortunately, I haven't put any effort into thinking about how to rationalize the bulk memory proposal without reference types or vice versa. |
wasmparser
incorrectly fails with: reference types support is not enabled
wasmparser
: Valid Wasm is not accepted if bulk-memory
is enabled and reference-types
is disabled
I stumbled upon this when implementing
bulk-memory
Wasm proposal support inwasmi
when integrating the new Wasm spec testsuite test cases for thebulk-memory
Wasm proposal. Note:wasmi
does not yet have support for thereference-types
Wasm proposal and I guess this is important for this issue.Namely, when parsing and validating the test cases via
wasmparser
(as always) it errors out with this message among others:The
wasmparser
error message is:reference types support is not enabled (at offset 0x74)
Querying the
wasmparser
codebase got me the following code segments:wasm-tools/crates/wasmparser/src/validator.rs
Line 256 in cacda73
Which filters out
ValType::FuncRef | ValType::ExternRef
types, however, thebulk-memory
Wasm proposal explicitly allowsValType::FuncRef
in so-calledelemexpr
which can only occur in Wasm element const experessions. I think this is the problematic code. (Not tested though.)Source:

bulk-memory
Wasm Proposal Overviewwasm-tools/crates/wasmparser/src/validator/operators.rs
Line 934 in cacda73
Unfortunately I am on
wasmparser 0.91
so this issue might have already been resolved in a newer version.Here is a link to the WIP
wasmi
PR in case this helps. (It is very WIP ...)The text was updated successfully, but these errors were encountered: