WebAssembly / gc

Branch of the spec repo scoped to discussion of GC integration in WebAssembly
https://webassembly.github.io/gc/
Other
987 stars 71 forks source link

[spec] Update global.get note on constant expressions #481

Closed takikawa closed 10 months ago

takikawa commented 10 months ago

Currently the spec has this note:

Note

Currently, constant expressions occurring in globals, element, or data segments are further constrained in that contained instructions are only allowed to refer to imported globals. This is enforced in the validation rule for modules by constraining the context accordingly.

The definition of constant expression may be extended in future versions of WebAssembly.

https://webassembly.github.io/gc/core/valid/instructions.html#valid-constant

I think this is outdated given that GC allows incremental validation of globals. IIUC, uses of global.get data and element segments are unconstrained now as well. This PR has a minimal change for this wording.

takikawa commented 10 months ago

I realized after pushing the first version that tables also have constraints that are different from globals (only imported globals for global.get), so I've added that too.