Skip to content

Add support for (ref ...) / (ref null ...) constructs#2562

Merged
sbc100 merged 1 commit into
WebAssembly:mainfrom
zherczeg:function_ref
Nov 7, 2025
Merged

Add support for (ref ...) / (ref null ...) constructs#2562
sbc100 merged 1 commit into
WebAssembly:mainfrom
zherczeg:function_ref

Conversation

@zherczeg

@zherczeg zherczeg commented Mar 11, 2025

Copy link
Copy Markdown
Collaborator

This large patch adds function references support for those parts of the wabt library, which already present in the code. The current code is designed for an older (outdated) variant of the function references proposal.

Key changes:

  • Var variables can optionally store type data. This way there is no need for a Var/Type field pair in many cases.
  • CallRef now needs to explicitly provide its reference type (no auto detection)
  • Tracking local reference initialization (non nullable refs must be set before using them)
  • Supporting type equality comparisons in the validator and in the interpreter
  • Adds a code for reading/writing 33 bit integers (leb format)
  • Remove EndTypeSection in shared validator, types can be validated earlier
  • Improve named reference resolving in the text parser

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants