-
Notifications
You must be signed in to change notification settings - Fork 111
Description
In #336 parsing of a value section depends on the contents of a component type section.
The types of all non primvaltypes refer to a typeidx. So a parser needs to look up the actual type in the component type section to know how to interpret the succeeding bytes.
component-model/design/mvp/Binary.md
Line 378 in 76cb955
| val(i:<typeidx>) ::= v:<val(type-index-space[i])> => v |
Is this the first time that the parsing of a section requires knowledge of the contents of a previous section?
It’s obviously already necessary for validation and execution, but I don’t think it has so far been the case for parsing in either Wasm modules or components, even for code sections. I believe that some Wasm consumers even use this property to do parsing and validation of sections in parallel which would no longer be possible, at least not when hitting a value section. I just wanted to check if I am correct.
I noticed this when working on adding support for value sections in wasmparser.