Skip to content

fix: ty() of null externref and exnref values - #14623

Merged
rvolosatovs merged 1 commit into
bytecodealliance:mainfrom
rvolosatovs:fix/null-ref-val-ty
Oct 9, 2026
Merged

rvolosatovs merged 1 commit into
bytecodealliance:mainfrom
rvolosatovs:fix/null-ref-val-ty

Conversation

@rvolosatovs

@rvolosatovs rvolosatovs commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Val::ExternRef(None).ty() returned (ref null nofunc) instead of (ref null noextern), and Ref::Exn(None).ty() returned (ref null none) instead of (ref null noexn). Neither type is matched by the value it was computed from, so e.g. creating a global with GlobalType::new(v.ty(&store)?, ..) and v as the initial value failed for a null externref.

See https://webassembly.github.io/spec/core/text/types.html#reference-types

`Val::ExternRef(None).ty()` returned `(ref null nofunc)` instead of
`(ref null noextern)`, and `Ref::Exn(None).ty()` returned
`(ref null none)` instead of `(ref null noexn)`. Neither type is
matched by the value it was computed from, so e.g. creating a global
with `GlobalType::new(v.ty(&store)?, ..)` and `v` as the initial value
failed for a null externref.

Assisted-by: claude:claude-opus-5-5
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
@rvolosatovs
rvolosatovs marked this pull request as ready for review October 9, 2026 15:41
@rvolosatovs
rvolosatovs requested a review from a team as a code owner October 9, 2026 15:41
@rvolosatovs
rvolosatovs requested review from pchickey and removed request for a team October 9, 2026 15:41
@rvolosatovs
rvolosatovs enabled auto-merge October 9, 2026 15:41
@rvolosatovs
rvolosatovs added this pull request to the merge queue Oct 9, 2026
Merged via the queue into bytecodealliance:main with commit 6afa55a Oct 9, 2026
53 checks passed
@rvolosatovs
rvolosatovs deleted the fix/null-ref-val-ty branch October 9, 2026 16:14
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.

2 participants