WebAssembly / WebAssembly/wabt

option for wasm-validate to output context

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

Nobody has claimed this yet.

Dominant language
C++
Stars
8.1k
Forks
827
Avg merge
4d 6h
Merged PRs (30d)
18

Description

Currently wasm-validate outputs the offending operation, however the context needs to be grep'ed manually:

wasm-validate  main.wasm   
main.wasm:000007b: error: type mismatch in i32.and, expected [i32, i32] but got [... i64, i32]

wasm-objdump main.wasm -d | grep -B3 7b
 000077: 20 03                      |   local.get 3 <width>
 000079: 53                         |   i64.lt_s
 00007a: 71                         |   i32.and
 00007b: 04 40                      |   if

It would be nice to have a flag for wasm-validate to directly output the context, maybe even smart enough to trace back all relevant preceding ops.

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 reproducing the shown validation error with wasm-validate and compare its address with wasm-objdump -d output. Read the wasm-validate command path and establish the intended context or tracing scope with maintainers. Done means the selected flag produces useful surrounding operations for the example, with tests covering the chosen output.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, wasm
Domain
cli, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.