WebAssembly / spec

WebAssembly specification, reference interpreter, and test suite.
https://webassembly.github.io/spec/
Other
3.13k stars 445 forks source link

Prose is missing steps for declared element segments during instantiation #1562

Closed eqrion closed 1 year ago

eqrion commented 1 year ago

The rules for module instantiation specify that declarative element segments are dropped during instantiation [1]:

runelem𝑖({type et, init ref 𝑛, mode declarative}) =
(elem.drop 𝑖)

But the prose only has a rule for active element segments:

For each element segment elem𝑖 in module.elems whose mode is of the form
active {table tableidx 𝑖, offset einstr *
𝑖 end}, do:
  ...

I think we need an extension to the prose to mention that declarative segments are dropped during instantiation.

[1] https://webassembly.github.io/spec/core/exec/modules.html#instantiation

rossberg commented 1 year ago

Oops, I accidentally committed to the repo instead of creating a branch, plus I screwed it up so had to hotfix it with another commit. :-{

But that aside, it should be fixed by the last two commits.

eqrion commented 1 year ago

Thanks!