Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Bug in reference core test #114

Closed
Closed
@q82419

Description

@q82419

If I'm correct, the test case in core/ref_func.wast should not pass.
https://github.com/WebAssembly/reference-types/blob/master/test/core/ref_func.wast#L80-L106

The following test case got an expected invalid result:

(assert_invalid
  (module (func $f (drop (ref.func $f))))
  "undeclared function reference"
)

Because the $f is not declared in elem.

I think it needs to add (elem declare func $f1 $f2) or (elem declare funcref (ref.func $f1) (ref.func $f2)) into the module in the above mentioned test case?
That is:


(module
  (func $f1)
  (func $f2)
  (func $f3)
  (func $f4)
  (func $f5)
  (func $f6)

  (table $t 1 funcref)

  (global funcref (ref.func $f1))
  (export "f" (func $f2))
  (elem declare funcref (ref.func $f1) (ref.func $f2))
  (elem (table $t) (i32.const 0) func $f3)
  (elem (table $t) (i32.const 0) funcref (ref.func $f4))
  (elem func $f5)
  (elem funcref (ref.func $f6))

  (func
    (ref.func $f1)
    (ref.func $f2)
    (ref.func $f3)
    (ref.func $f4)
    (ref.func $f5)
    (ref.func $f6)
    (return)
  )
)

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