You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Print custom sections by default in wasmprinter (#1449)
* Print custom sections by default in `wasmprinter`
The annotations proposal for WebAssembly added `@custom` syntax to the
text format of WebAssembly and while `wast` has supported parsing it for
quite some time now the `wasmprinter` half has not printed it. This was
mostly just for historical reasons, but this decision ends up causing
confusion for folks when they round-trip a binary through the text
format and are surprised when the result is different. An example of
this is that the `component-type*` custom sections for components are
lost when roundtripping and that can break the componentization process.
This commit updates to instead print these sections by default. That
does mean that many modules coming out of compilers may have lots of
DWARF information now printed, but this feels like a better default than
always ignoring them entirely.
It's worth noting here that `wasmprinter` and `wast` try to round-trip
the structure of a module but won't ever round trip a module
byte-for-byte. For example overlong LEB encodings will never be
reproduced. This means that while this commit will roundtrip custom
sections it won't guarantee that the custom section continues to work
because the offsets within the module when converted back to binary may
still be different.
* Fix some mutation tests to work on 32 and 64-bit
* Normalize WIT comments to `\n` from `\r\n`
0 commit comments