Skip to content

How to validate the ref.func instruction #1759

Answered by rossberg
CharlieTap asked this question in Q&A
Discussion options

You must be logged in to vote

C.refs is initialised here:

C.refs is the set funcidx(module with funcs = ε with start = ε), i.e., the set of function indices occurring in the module, except in its functions or start function.

This is saying that C.refs must only include function indices that occur outside any function. Hence, the latter example fails because the only occurrence of $f is inside a function, while in the other test, $f does also occur in an element segment, so outside a function.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@CharlieTap
Comment options

@rossberg
Comment options

Answer selected by CharlieTap
@CharlieTap
Comment options

@bashor
Comment options

@tlively
Comment options

@rossberg
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants