WebAssembly / spec

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

[spec] Fix table_alloc signature #1658

Closed ghost closed 1 year ago

ghost commented 1 year ago

While reading over some of the Editor's Draft regarding tables at https://webassembly.github.io/spec/js-api/#tables, I noticed that it links to the core specification table_alloc https://webassembly.github.io/spec/core/appendix/embedding.html#embed-table-alloc.

Editor's Draft:

Let (store, tableaddr) be table_alloc(store, type, ref).

Core specification:

table_alloc(store, tabletype) : (store, tableaddr, ref)
...
table_alloc(S, tt, r) = (S', a) (if alloctable(S, tt, r) = S', a)

Clearly, it seems like the ref in the result 3-tuple should be moved to be the third parameter instead, given the mismatch between the definition and its header.