WebAssembly / WebAssembly/wabt
`--no-check` produces malformed module
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 8.1k
- Forks
- 827
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 18
Description
This is effectively moved from https://github.com/WebAssembly/testsuite/issues/132 to here.
In short, compiling the following module with wat2wasm and --no-check:
(module
(func (export "test")
(data.drop 0)))
leads to a WASM module that contains no data count section. According to the official specification, if a module uses data.drop or memory.init, it needs to contain a data count section.
Arguably this entire situation is bogus simply because we need to compile with --no-check for this to even compile. Interestingly enough though this seems to be only situation where --no-check leads a malformed and not an invalid module. In this case that causes some confusion when strictly interpreting the testsuite test cases w.r.t. if a module should fail to parse or fail to validate.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with wat2wasm, --no-check, and the WAT module shown in the report. Trace how data.drop is handled during module emission and check the existing compiler tests for a suitable regression case. Done means the generated module follows the specification's data-count requirement, with test coverage for this input.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- cli, compilers, devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100