[wasm-split] Use a fresh table when reference types are enabled#6726
Merged
[wasm-split] Use a fresh table when reference types are enabled#6726
Conversation
Rather than trying to trampoline primary-to-secondary calls through an existing table, just create a fresh table for this purpose. This ensures that modifications to the existing tables cannot interfere with primary-to-secondary calls and conversely that loading the secondary module cannot overwrite modifications to the tables.
kripken
approved these changes
Jul 11, 2024
Member
Author
|
Looks like this uncovered an existing bug in how we handled function references in active segments. I'm glad we're going to get fuzzer coverage for this! |
Member
Author
|
This change will make primary-to-secondary indirect calls slower because they will now trampoline to a second indirect call made through the fresh table. Perhaps we should consider adding a flag to keep the old behavior for use with Emscripten now that reference-types are on by default? (or will be soon?) But we wouldn't be able to fuzz effectively with that flag enabled, so it would be risky. |
kripken
approved these changes
Jul 11, 2024
Member
|
The extra indirection seems annoying, but yeah, adding a flag would have downsides too. Maybe it's worth measuring though. |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rather than trying to trampoline primary-to-secondary calls through an
existing table, just create a fresh table for this purpose. This ensures
that modifications to the existing tables cannot interfere with
primary-to-secondary calls and conversely that loading the secondary
module cannot overwrite modifications to the tables.