Skip to content

wasmparser: Increase MAX_WASM_COMPONENT_TYPE_DECLS to 1_000_000 #2256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 18, 2025

Conversation

MangoPeachGrape
Copy link
Contributor

I was hitting against a linker error when using wit-bindgen in Rust with more than 100k functions.

A simple wit file to reproduce this:

package x:xx;
world xxx {
	import a0: func();
	import a1: func();
	import a2: func();
	import a3: func();
        ...
        ...
	import a99999: func();
	import a100000: func();
}

The error:

  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: error: failed to parse core wasm for componentization

          Caused by:
              0: decoding custom section component-type:wit-bindgen:0.43.0:x:xx:xxx:encoded world
              1: component type declaration size is out of bounds (at offset 0x2c)

With this change I tested up to 200k functions with no problems.

Similar to #2087

@MangoPeachGrape MangoPeachGrape requested a review from a team as a code owner July 17, 2025 23:16
@MangoPeachGrape MangoPeachGrape requested review from alexcrichton and removed request for a team July 17, 2025 23:16
@alexcrichton alexcrichton added this pull request to the merge queue Jul 17, 2025
Merged via the queue into bytecodealliance:main with commit 847d7db Jul 18, 2025
32 checks passed
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