wabt icon indicating copy to clipboard operation
wabt copied to clipboard

option for wasm-validate to output context

Open pannous opened this issue 1 year ago • 0 comments

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.

pannous avatar Dec 13 '22 12:12 pannous