Skip to content

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

Open
alexcrichton wants to merge 1 commit intobytecodealliance:mainfrom
alexcrichton:fix-validation-of-aliases
Open

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

Conversation

@alexcrichton
Copy link
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
Member Author

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

Copy link

@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!

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