wabt icon indicating copy to clipboard operation
wabt copied to clipboard

Type identifiers in the name section are lost during round trip.

Open 7ombie opened this issue 3 years ago • 2 comments

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.

7ombie avatar Jul 06 '21 01:07 7ombie

~~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).

7ombie avatar Jul 14 '21 22:07 7ombie

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.

7ombie avatar Jul 14 '21 23:07 7ombie