binaryen icon indicating copy to clipboard operation
binaryen copied to clipboard

Table init exprs appear to be unimplemented

Open wingo opened this issue 2 years ago • 1 comments

I would like to use tables of non-nullable values but Binaryen does not appear to support them.

Relatedly, the binary format parser does not appear to support init value expressions for tables.

I would note that there would appear to be some confusion about the encoding; in https://github.com/WebAssembly/function-references/commit/3eea65616b4eef8ff90d5095f73910d712522ff9, not part of a PR, the encoding becomes 0x40 0x00 tabletype expr, whereas V8 does not yet expect the 0x00 intermediate byte (and it's not in https://docs.google.com/document/d/1DklC3qVuOdLHSXB5UXghM_syCh-4cMinQ50ICiXnK3Q/edit#heading=h.3i2qhyi67r2d).

wingo avatar Apr 05 '23 13:04 wingo

I've partially implemented this (enough to satisfy my own needs) in https://github.com/pufferfish101007/binaryen/commit/26fa2e2190aea44b26f15e34bc2c2f64e1048524; this was my first time using C++ so it's probably not very good, but if I happen to finish it off (by patching the text-format parser and adding tests), I can open a pull request here.

pufferfish101007 avatar Apr 21 '25 08:04 pufferfish101007