GeezerVison is showing github.com — Missing validation error · Issue #8785 · WebAssembly/binaryen
Missing validation error #8785
Description
See jj.tar.gz.
Unpack via:
When running with V8 we get a validation error:
% d8 $PWD/pkg/dart2wasm/bin/run_wasm.js -- $PWD/jj.mjs $PWD/jj.wasm
run_wasm.js:346: CompileError: WebAssembly.compile(): Compiling function #181:"main" failed: not enough arguments on the stack for drop (need 1, got 0) @+25996
}
^
CompileError: WebAssembly.compile(): Compiling function #181:"main" failed: not enough arguments on the stack for drop (need 1, got 0) @+25996
1 pending unhandled Promise rejection(s) detected.
Though optimizing with wasm-opt works fine and the result runs:
% wasm-opt --enable-gc --enable-reference-types --enable-multivalue --enable-exception-handling --enable-nontrapping-float-to-int --enable-sign-ext --enable-bulk-memory --enable-threads --enable-simd '--no-inline=*<noInline>*' --traps-never-happen -g -Os --gufa -Os -Os jj.wasm -o jj.wasm
% d8 $PWD/pkg/dart2wasm/bin/run_wasm.js -- $PWD/jj.mjs $PWD/jj.wasm
%
Is wasm-opt not supposed to issue a validation error here as well? (even though the corresponding code is unreachable)
local.get $reporter
drop
drop
block $label2
unreachable
end
dropActivity
tlively commented on May 28, 2026
This is WAI for now, unfortunately. Binaryen represents that block as having bottom type internally, so this parses into valid Binaryen IR, even though it is not valid WebAssembly. A fix would involve adding an entirely new validator in the parser, since the IR does not retain enough information to detect this error.
added a commit that references this issue
on Aug 16, 2026This issue will close once commit 999c1cd is merged into the 'main' branch.999c1cd
Metadata
Metadata
Development
No branches or pull requestsIssue actions