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

wasm-merge: Sort globals to ensure proper validation #6221

Merged
merged 3 commits into from
Jan 11, 2024

Conversation

kripken
Copy link
Member

@kripken kripken commented Jan 11, 2024

If the first module has a global that reads from a global that appears in a later
module, then we need to reorder the globals, because if we just append the
globals from the later module we'd end up with a global reading from another
that is not before it.

Changes to the existing renamings test are just due to the global sorting
pass that now runs (it not only fixes up validation errors but also tries to sort
in a more optimal order for size).

Fixes #6220

@kripken kripken merged commit e5948a9 into WebAssembly:main Jan 11, 2024
14 checks passed
@kripken kripken deleted the merge.sort.globals branch January 11, 2024 19:11
radekdoulik pushed a commit to dotnet/binaryen that referenced this pull request Jul 12, 2024
If the first module has a global that reads from a global that appears in a later
module, then we need to reorder the globals, because if we just append the
globals from the later module we'd end up with a global reading from another
that is not before it.

Changes to the existing renamings test are just due to the global sorting
pass that now runs (it not only fixes up validation errors but also tries to sort
in a more optimal order for size).

Fixes WebAssembly#6220
@gkdn gkdn mentioned this pull request Aug 31, 2024
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.

wasm-merge emits non-imported global initializer expression
2 participants