spec icon indicating copy to clipboard operation
spec copied to clipboard

Declarative element segments are not available at runtime, but used in runtime in a test

Open osa1 opened this issue 7 months ago • 0 comments

From https://webassembly.github.io/spec/core/syntax/modules.html#element-segments:

A declarative element segment is not available at runtime but merely serves to forward-declare references that are formed in code with instructions like.

table.init requires an element segment in runtime: https://webassembly.github.io/spec/core/exec/instructions.html#xref-syntax-instructions-syntax-instr-table-mathsf-table-init-x-y

So my understanding it a elem declare section cannot be named, or at least cannot be referred to in a table.init.

But we have this that names a declarative elem segment, and then initializes a table in runtime using it:

https://github.com/WebAssembly/spec/blob/abc8d16dcb4b36f818af9ee2fa9b1bf0b50503cb/test/core/elem.wast#L352-L360

Should the test be updated?

osa1 avatar Jun 16 '25 09:06 osa1