Skip to content

Conversation

Mintyboi
Copy link

When accessing functions from the splitted module, there's an error because the wasmtable is using table64. So we would have to access it with a BigInt. This has been updated in other part of the codebase, but we missed this file.

We can use the `toIndexType` utility function to access the wasm table
Copy link
Collaborator

@sbc100 sbc100 left a comment

Choose a reason for hiding this comment

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

I guess this means we don't have any test coverage for wasm64 + module splitting?

Can you try adding @also_with_wasm64 to test_split_module? Can you confirm it doesn't work without this fix?

Otherwise lgtm!

src/preamble.js Outdated
return wasmTable.get(toIndexType(1 + parseInt(prop)))(...args);
#else
return wasmTable.get(toIndexType(prop))(...args);
prop = 1 + parseInt(prop)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: add a semicolon at end of line.

@Mintyboi
Copy link
Author

I guess this means we don't have any test coverage for wasm64 + module splitting?

This seems to be the case.
Else it would have failed without this fix as well WebAssembly/binaryen#7904

@sbc100
Copy link
Collaborator

sbc100 commented Sep 30, 2025

lgtm with the test update

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