-
Notifications
You must be signed in to change notification settings - Fork 844
Open
Description
Summary
Binaryen wasm-opt rejects a valid module with:
parse exception: invalid tag index (at 0:51)
This reproduces on both:
- local
wasm-opt version 125 (version_125) - current upstream release
wasm-opt version 128 (version_128)
wasm-tools validate accepts the same module.
Minimal Repro
(module
(rec
(type (array i16))
(type (sub (struct)))
(type (array (mut nullexternref)))
(type (sub (func (param i64))))
(type (array (mut f32)))
(type (sub (array (mut v128))))
)
(elem declare (ref null 2))
(elem declare (ref null 3) (ref.null 3))
(elem declare nullref)
(func (type 3) (param i64))
(func (type 3) (param i64))
)Reproduction
cat > repro.wat <<'WAT'
(module
(rec
(type (array i16))
(type (sub (struct)))
(type (array (mut nullexternref)))
(type (sub (func (param i64))))
(type (array (mut f32)))
(type (sub (array (mut v128))))
)
(elem declare (ref null 2))
(elem declare (ref null 3) (ref.null 3))
(elem declare nullref)
(func (type 3) (param i64))
(func (type 3) (param i64))
)
WAT
wasm-tools parse repro.wat -o repro.wasm
wasm-tools validate repro.wasm
wasm-opt repro.wasm --all-features -o out.wasmActual Result
[parse exception: invalid tag index (at 0:51)]
Fatal: error parsing wasm (try --debug for more info)
Expected Result
Binaryen should parse the module successfully, or reject it with a different validation/parsing error if the module is actually invalid under the enabled features.
Provenance
I hit this while differentially fuzzing remove-unused-names against Binaryen in Starshine, but the failure reproduces without any pass flags at all:
wasm-opt repro.wasm --all-features -o out.wasmThe original saved fuzz case is a valid module accepted by wasm-tools validate and replays as a pure Binaryen command failure rather than a semantic mismatch.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels