Skip to content

[reference types]: ref.func declaration check is overly strict #1893

@takikawa

Description

@takikawa

When function indices are used in ref.func, there is a check to make sure the index is declared in the element section before the code section.

However, this check is too strong in wabt as uses in the global section should be ok. Example:

;; the reference in the global is ok
(module (func $f1) (global funcref (ref.func $f1)))

It fails to validate in wabt (validates in the reference interpreter though):

func.wat:1:46: error: function 0 is not declared in any elem sections
(module (func $f1) (global funcref (ref.func $f1)))

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