wasmx / wasm-chisel

Some useful utilities to transform WebAssembly binaries.
Apache License 2.0
56 stars 11 forks source link

Make DropSection treat the name section as a custom section #144

Closed jakelang closed 5 years ago

jakelang commented 5 years ago

According to the spec, a name section is just a custom section with the name "name". Although dropsection already has a mode to drop the names section, we should still treat the names section as a custom section for spec compliance.

axic commented 5 years ago

The real simplification here could be changing find_index to call custom_section_index_for("name") for the NamesSection case, adding the above change and removing names_section_index_for.

axic commented 5 years ago

Just realised we don't have tests for the names section.

axic commented 5 years ago

Could have added a test checking the behaviour of dropping the names section..