WebAssembly / spec

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

Add a note indicating that section ids and section ordering do not correspond #1733

Closed esoterra closed 4 months ago

esoterra commented 4 months ago

It is very easy to find the section id table before the grammar for module section layout and assume that they correspond.

The fact that data count appears before code in the binary but has the last section ID is very easy to miss and tooling does not always give intuitive errors.

Recommendation: Add a note right underneath the section ID table saying something like

Note: Section ID does not correspond to section order in the binary. See modules for the ordering.

rossberg commented 4 months ago

Please see #1734.

esoterra commented 4 months ago

Thanks!