Skip to content

Fuzz bug on type emitting #4756

@kripken

Description

@kripken
$ v8 a.wasm.js --wasm-staging --experimental-wasm-eh --experimental-wasm-compilation-hints \
   --experimental-wasm-gc --experimental-wasm-typed-funcref --experimental-wasm-memory64 \
  --experimental-wasm-extended-const -- w.wasm

$ wasm-opt w.wasm -o z.wasm -all --disable-gc --nominal
warning: no passes specified, not doing any work

$ v8 a.wasm.js --wasm-staging --experimental-wasm-eh --experimental-wasm-compilation-hints \
   --experimental-wasm-gc --experimental-wasm-typed-funcref --experimental-wasm-memory64 \
  --experimental-wasm-extended-const -- z.wasm
a.wasm.js:38: CompileError: WebAssembly.Module(): Type index 1 is out of bounds @+14
var instance = new WebAssembly.Instance(new WebAssembly.Module(binary), {
                                        ^
CompileError: WebAssembly.Module(): Type index 1 is out of bounds @+14
    at a.wasm.js:38:41

That is, round-tripping the wasm using -all --disable-gc --nominal results in a binary that v8 cannot read.
bug.zip

cc @tlively - this sounds like a recent issue we had that also related to nominal mode without GC enabled?

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