Repository navigation
Closed
Description
STR: wasm-opt w.wasm -all --print --name-types --print
The output is
(module
(type $none_=>_none (func))
(global $global$0 (ref null $none_=>_none) (ref.func $0))
(global $global$1 i32 (i32.const 0))
(global $global$2 (mut externref) (ref.null extern))
(global $global$3 (mut i32) (i32.const -6567))
(global $global$4 (mut anyref) (ref.null any))
(global $global$5 (mut i32) (i32.const 10))
(memory $0 (shared 16 17))
(table $0 16 funcref)
(table $1 28 funcref)
(table $2 18 18 funcref)
(table $3 0 0 externref)
(elem $0 (table $0) (i32.const 0) func)
(elem $1 (table $1) (i32.const 0) func)
(elem $2 (table $1) (i32.const 1) func)
(elem $3 (table $2) (i32.const 0) func)
(elem $4 (table $2) (i32.const 2) func)
(elem $5 func)
(elem $6 func)
(elem $7 (ref null $none_=>_none) (ref.func $0) (ref.func $0) (ref.null $none_=>_none))
(elem $8 func)
(func $0
(nop)
)
)
(module
(type $type$0 (func))
(global $global$0 (ref null $type$0) (ref.func $0))
(global $global$1 i32 (i32.const 0))
(global $global$2 (mut externref) (ref.null extern))
(global $global$3 (mut i32) (i32.const -6567))
(global $global$4 (mut anyref) (ref.null any))
(global $global$5 (mut i32) (i32.const 10))
(memory $0 (shared 16 17))
(table $0 16 funcref)
(table $1 28 funcref)
(table $2 18 18 funcref)
(table $3 0 0 externref)
(elem $0 (table $0) (i32.const 0) func)
(elem $1 (table $1) (i32.const 0) func)
(elem $2 (table $1) (i32.const 1) func)
(elem $3 (table $2) (i32.const 0) func)
(elem $4 (table $2) (i32.const 2) func)
(elem $5 func)
(elem $6 func)
(elem $7 (ref null $type$0) (ref.func $0) (ref.func $0) (ref.null $none_=>_none))
(elem $8 func)
(func $0
(nop)
)
)The key thing is the $none_=>_none type, which should not exist after we name the types. It appears twice in the element segments, and remains in one of them at the end. It seems that the two may have gotten different types..?
cc @tlively
(found by fuzzer seed 9943180413750209438, then reduced. it can't be reduced by hand as the bug does not show itself on the text format...)
Metadata
Metadata
Assignees
Labels
No labels
Activity
tlively commentedon Jul 19, 2021
Interesting find! I would expect issues like this with nominal typing enabled, but not with the default equirecursive typing. Will investigate.
Disable RoundtripText fuzzer until #3989 is fixed
Disable RoundtripText fuzzer until #3989 is fixed (#4058)
tlively commentedon Apr 29, 2024
This no longer seems to reproduce after switching to the new parser and making a bunch of other changes that might have been related.