Skip to content
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

Fix convertJsFunctionToWasm when the signature has more than 122 arguments #16658

Merged
merged 5 commits into from
Apr 5, 2022

Conversation

hoodmane
Copy link
Contributor

@hoodmane hoodmane commented Apr 5, 2022

With this patch, convertJsFunctionToWasm works correctly with up to 1000 arguments. Called with 1001 arguments, Chrome, Firefox, and Node all agree that WebAssembly.Module(): param count of 1001 exceeds internal limit of 1000

hoodmane added a commit to pyodide/pyodide that referenced this pull request Apr 5, 2022
All libffi tests pass now. The only failing ctypes test is test_callback_too_many_args which doesn't segfault anymore, it only soft fails. Planning to submit a PR to cpython that fixes test_callback_too_many_args.
See also:
bugs.python.org/issue47208
emscripten-core/emscripten#16658
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

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

Ah, good find that the underlying issue was the LEB encoding...

lgtm % comments

src/runtime_functions.js Outdated Show resolved Hide resolved
src/runtime_functions.js Outdated Show resolved Hide resolved
src/runtime_functions.js Outdated Show resolved Hide resolved
src/runtime_functions.js Outdated Show resolved Hide resolved
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

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

(fixed some more whitespace issues)

lgtm!

@kripken kripken enabled auto-merge (squash) April 5, 2022 21:25
@kripken kripken merged commit 7ff7855 into emscripten-core:main Apr 5, 2022
@hoodmane hoodmane deleted the convertjsfunc2wasm-many-args branch June 22, 2022 18:58
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