wabt
wabt copied to clipboard
Type identifiers in the name section are lost during round trip.
When converting a binary that contains an extended name section to WAT, the identifiers are all preserved, except type and label identifiers, which are seemingly just ignored.
~~I've opened an issue on WABTJS that is related to this one, but also includes an example (using WABTJS) that reproduces the problem.~~ The problem is in WABT (not WABTJS).
I've confirmed now that the issue is with WABT (not WABTJS, so closed the issue on their repo).
The following shell commands illustrate how to reproduce the issue for type names:
$ cat test.wat
(module $module
(type $type (func)))
$ wat2wasm --debug-names test.wat
$ wasm2wat test.wasm --output=result.wat
$ cat result.wat
(module $module
(type (;0;) (func)))
I don't know whether or not the issue with labels relates to this issue with type names, but they seem related.
Note: I'm not using any DWARF debugging sections (in this example, or my actual compiler, where the issue first arose), so am certain it's not related to that.