diff options
author | Alon Zakai <azakai@google.com> | 2024-01-11 11:11:15 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-11 11:11:15 -0800 |
commit | e5948a939eb6610f1cb7742df8c54f6d17389b83 (patch) | |
tree | be3db7721599df7f53aa747c0e4581109a188f22 /test/lit/merge/global-ordering.wat.second | |
parent | 141f7cad3aa516db3828e619b31fe681e46a151b (diff) | |
download | binaryen-e5948a939eb6610f1cb7742df8c54f6d17389b83.tar.gz binaryen-e5948a939eb6610f1cb7742df8c54f6d17389b83.tar.bz2 binaryen-e5948a939eb6610f1cb7742df8c54f6d17389b83.zip |
wasm-merge: Sort globals to ensure proper validation (#6221)
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
Diffstat (limited to 'test/lit/merge/global-ordering.wat.second')
-rw-r--r-- | test/lit/merge/global-ordering.wat.second | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/lit/merge/global-ordering.wat.second b/test/lit/merge/global-ordering.wat.second new file mode 100644 index 000000000..7676599e4 --- /dev/null +++ b/test/lit/merge/global-ordering.wat.second @@ -0,0 +1,3 @@ +(module + (global $second.global (export "second.global.export") i32 (i32.const 42)) +) |