Skip to content

Limit total components/modules in validation - #2730

Merged
alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:limit-components-and-modules
Oct 2, 2026
Merged

alexcrichton merged 1 commit into
bytecodealliance:mainfrom
alexcrichton:limit-components-and-modules

Conversation

@alexcrichton

Copy link
Copy Markdown
Member

This commit places a total limit on the number of nested components/modules within an entire outer component. Previously wasmparser would limit components/modules within one component, but the goal of this limit is to ensure that the entire total cap is limited. The original motivation for this is that wasmparser currently has some quadratic handling of type information when components/modules end, so components with lots of constituents can take an inordinately long amount of time to validate. Placing a limit is a bit of a quick fix for that and if we want to increase the limit we'll want to work on better data structures internally.

This commit places a total limit on the number of nested
components/modules within an entire outer component. Previously
wasmparser would limit components/modules within one component, but the
goal of this limit is to ensure that the entire total cap is limited.
The original motivation for this is that wasmparser currently has some
quadratic handling of type information when components/modules end, so
components with lots of constituents can take an inordinately long
amount of time to validate. Placing a limit is a bit of a quick fix for
that and if we want to increase the limit we'll want to work on better
data structures internally.
@alexcrichton
alexcrichton requested a review from a team as a code owner October 1, 2026 23:46
@alexcrichton
alexcrichton requested review from dicej and removed request for a team October 1, 2026 23:46
@alexcrichton
alexcrichton added this pull request to the merge queue Oct 2, 2026
Merged via the queue into bytecodealliance:main with commit ade0282 Oct 2, 2026
37 checks passed
@alexcrichton
alexcrichton deleted the limit-components-and-modules branch October 2, 2026 14:41
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