The preamble is followed by a sequence of sections. Custom sections may be inserted at any place in this sequence, while other sections must occur at most once and in the prescribed order. All sections can be empty.
the current implementation use a for loop to decode the section data. so the prescribed order is not checked.
from the WebAssembly Specifications
the current implementation use a for loop to decode the section data. so the prescribed order is not checked.
A similar processing logic as a reference is at https://github.com/CraneStation/cranelift/blob/master/cranelift-wasm/src/module_translator.rs#L14