Skip to content

Disallow non-type/instance aliases in component/instance types#2462

Merged
alexcrichton merged 1 commit intobytecodealliance:mainfrom
alexcrichton:fix-validation-of-aliases
Mar 31, 2026
Merged

Disallow non-type/instance aliases in component/instance types#2462
alexcrichton merged 1 commit intobytecodealliance:mainfrom
alexcrichton:fix-validation-of-aliases

Conversation

@alexcrichton
Copy link
Copy Markdown
Member

This fixes a bug in the validation of components where previously invalid alias items were allowed to be present in instance and component type definitions. The specification indicates that these should be disallowed and wasmparser erroneously allowed them. The impact of this change is expected to be nonexistent or negligible as this only applies to handwritten components. Components produced by wit-component do not use this feature so no previously produced component should be rejected. Additionally the impact of allowing these invalid alias annotations is also negligible as you couldn't actually do anything with the item anyway so it was just sort of dead bloat in a binary.

cc WebAssembly/component-model#621

This fixes a bug in the validation of components where previously
invalid `alias` items were allowed to be present in `instance` and
`component` type definitions. The specification indicates that these
should be disallowed and `wasmparser` erroneously allowed them. The
impact of this change is expected to be nonexistent or negligible as
this only applies to handwritten components. Components produced by
`wit-component` do not use this feature so no previously produced
component should be rejected. Additionally the impact of allowing these
invalid `alias` annotations is also negligible as you couldn't actually
do anything with the item anyway so it was just sort of dead bloat in a
binary.

cc WebAssembly/component-model#621
@alexcrichton alexcrichton requested a review from a team as a code owner March 11, 2026 16:51
@alexcrichton alexcrichton requested review from dicej and removed request for a team March 11, 2026 16:51
@alexcrichton
Copy link
Copy Markdown
Member Author

cc @lukewagner mind double-checking the logic here too?

Copy link
Copy Markdown

@lukewagner lukewagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!

@alexcrichton
Copy link
Copy Markdown
Member Author

ping @dicej mind taking a look at this?

@alexcrichton alexcrichton added this pull request to the merge queue Mar 31, 2026
Merged via the queue into bytecodealliance:main with commit 9e5a085 Mar 31, 2026
36 checks passed
@alexcrichton alexcrichton deleted the fix-validation-of-aliases branch March 31, 2026 18:44
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