Closed Huxpro closed 5 years ago
Ah, good find. This is actually wrong in the main spec. The judgement changed from the former to the form with the k at some point, but it seems like I forgot to adapt the occurrences in the rules for tableinst and moduleinst.
Care to create a PR against the main spec?
@rossberg will do!
I couldn't find out the use of "valid limit" rule in the moduleinst
. Could you point out?
If I understood it correct, I could image two fixes for the tableinst
:
vdash limit 2^32
.funcref
, i.e. vdash limit funcref ok
.I guess (2) is preferable?
The minimal and direct fix is (1), i.e., to replace "\ok" with ": 2^K" in the two instance rules, where K is 32 for tables and 16 for memories. I would go for that.
The perhaps nicer but much more extensive fix would be to change the definition of tableinst and meminst to actually store tabletypes and memtypes instead of just limits. That's a change I had to make for the reference types proposal (along with the analogous change for globalinst). If you feel like it, you could backport that change, but I wouldn't necessarily recommend spending the time on it.
@rossberg two PRs respectively have been made against the main spec. Personally, I prefer (2) even more after looking at the reference-type proposal spec you mentioned. See reasons in https://github.com/WebAssembly/spec/pull/1094
In the https://webassembly.github.io/multi-value/core/appendix/properties.html#table-instances to validate tableinst, it use the rule
which seems to be undefined.
The
vdash
is linked to https://webassembly.github.io/multi-value/core/valid/types.html#valid-limits which is validated respect to somek
.The closest one is the https://webassembly.github.io/multi-value/core/valid/types.html#memory-types which conclude
\vdash limit ok
from\vdash limit : 2^16