Skip to content

[wasm-merge] Handle table initializer referring to imported global - #9167

Open
vouillon wants to merge 1 commit into
WebAssembly:mainfrom
vouillon:wasm-merge-fix
Open

vouillon wants to merge 1 commit into
WebAssembly:mainfrom
vouillon:wasm-merge-fix

Conversation

@vouillon

Copy link
Copy Markdown
Contributor

Unlike global initializers and element segments (which under GC may refer to preceding module-defined globals), a table initializer expression may only refer to imported globals. Fusing can turn an imported global that a table initializer refers to into a module-defined one, which would make the initializer invalid. When that happens, inline the referenced global's (immutable, constant) value so the initializer remains valid.

Unlike global initializers and element segments (which under GC may
refer to preceding module-defined globals), a table initializer
expression may only refer to imported globals. Fusing can turn an
imported global that a table initializer refers to into a module-defined
one, which would make the initializer invalid. When that happens, inline
the referenced global's (immutable, constant) value so the initializer
remains valid.
@vouillon
vouillon requested a review from a team as a code owner September 28, 2026 18:09
@vouillon
vouillon requested review from aheejin and removed request for a team September 28, 2026 18:09

This branch has not been deployed

No deployments
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.

1 participant