WebAssembly / WebAssembly/wabt
wast2json assertion failure when file contains malformed module
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 8.1k
- Forks
- 827
- Avg merge
- 4d 6h
- Merged PRs (30d)
- 18
Description
For the input file
(module quote "")
wast2json 1.0.13 crashes:
$ wast2json malformed.wast --no-check
wast2json: /home/andrei/dev/wabt/src/wast-parser.cc:474: wabt::Token wabt::WastParser::Consume(): Assertion `!tokens_.empty()' failed.
Aborted (core dumped)
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 crash with the shown malformed.wast input and --no-check command. Inspect src/wast-parser.cc around Consume() line 474, then trace how the malformed module leaves the parser without tokens; done means wast2json handles this input without an assertion failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, wasm
- Domain
- compilers, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100