wabt icon indicating copy to clipboard operation
wabt copied to clipboard

Disallow non-zero table idx if reference types disabled

Open chfast opened this issue 5 years ago • 0 comments

If the reference types extension is disabled, do not allow table index in the element segment other than zero.

Here I'm not 100% sure I identified the extension right. And considering the complexity of the ReadElemSection, I decided to just check flags !=0 at the beginning, so the error message is less precise than it could be.

chfast avatar Sep 18 '20 17:09 chfast

Closing as stale. My understanding is that the current code with --disable-reference-types will correctly fail validation for an elem segment with a non-zero tableidx, just because the tableidx will be out of range. So I'm not sure this has to be a parse failure vs. a validation failure. Please reopen if you feel differently; I know there's a lot of interests in being able to enforce the 1.0/MVP spec.

keithw avatar Aug 16 '22 18:08 keithw