WebAssembly/binaryen

Parser error on CallRef of shared nofunc

kripken opened this issue · 2 comments

(module
  (type $func (func))

  (func $test
    (call_ref $func
      (ref.as_non_null
        (ref.null (shared nofunc))
      )
    )
  )
)
$ wasm-opt a.wat -all
Fatal: 5:5: error: invalid reference type on stack

It works as expected without shared.

@tlively perhaps something in the parser needs to be generalized?

This looks correct to me. The type of the function reference is (ref (shared nofunc), which is not a subtype of (ref null $func), the type expected by call_ref $func, because it differs in heap type shareability.

I see, thanks. Then the question is how this situation came about. I don't have the original fuzzer testcase anymore but we'll see if it recurs.