Skip to content

Conversation

@tlively
Copy link
Member

@tlively tlively commented Jul 11, 2024

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.

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.
@tlively tlively requested a review from kripken July 11, 2024 02:03
@tlively
Copy link
Member Author

tlively commented Jul 11, 2024

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!

@tlively
Copy link
Member Author

tlively commented Jul 11, 2024

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
Copy link
Member

kripken commented Jul 11, 2024

The extra indirection seems annoying, but yeah, adding a flag would have downsides too. Maybe it's worth measuring though.

@tlively tlively merged commit c64ac5d into main Jul 11, 2024
@tlively tlively deleted the wasm-split-reftypes-table branch July 11, 2024 21:06
@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.

3 participants