Closed
Description
Hello there, I recently came across a Wasm module which cannot be parsed by Binaryen:
$ wabt/bin/wasm2wat test.wasm
(module
(type (;0;) (func (result i32)))
(type (;1;) (func (param i32) (result i32)))
(func (;0;) (type 0) (result i32)
i32.const 1
block (param i32) (result i32) ;; label = @1
i32.const 2
i32.add
end)
(export "param" (func 0)))
When using wasm-dis to parse above wasm module, it encountered following errors:
$ wasm-dis test.wasm
[parse exception: Block requires more values than are available (at 0:48)]
Fatal: error parsing wasm (try --debug for more info)
However, when using wasm2wat provided by WABT, it parsed successfully and wasm-interp runs param
function without error:
$ wasm-interp test.wasm -r "param"
param() => i32:3
The binaryen version I tested is 16a5993, which is currently the newest commit version.
Metadata
Metadata
Assignees
Labels
No labels