Skip to content

Missing validation error #8785

Description

@mkustermann

See jj.tar.gz.

Unpack via:

% tar xvzf jj.tar.gz
...

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
        drop

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions