WebAssembly / WebAssembly/binaryen

[wasm-validate] Error messages for name custom sections are not very concise

Open
#2,309 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
WebAssembly
Stars
8.6k
Forks
885
Avg merge
1d 19h
Merged PRs (30d)
69

Description

  • When I add a name custom section the the start of a file, the error reads: expected function name count (9) <= function count (0).
  • Putting the name section after type section: Memory section can not occur after Name section
  • Putting it after the memory section: Global section can not occur after Name section
  • Putting it after the memory section: Export section can not occur after Name section
  • Putting it after the memory section: Start section can not occur after Name section
  • Putting it after the memory section: Code section can not occur after Name section

I feel like the error message should include straight away that a name section must appear after the code section.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the wasm-validate handling for name custom sections and reproduce the ordering cases listed in the issue. Done means the resulting errors clearly state that a name section must appear after the code section and remain concise for each invalid placement.

Written by the indexing model from the issue text.

Assessment

Tech stack
wasm
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.