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.
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.
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.
Currently the spec has this note:
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.