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
{{ message }}
Repository navigation
Strange symbols don't roundtrip through wasm2wat and wat2wasm #685
Over in alexcrichton/wasm-gc#8 I'm experimenting with demangling rust symbols in wasm output. This results in symbol names such as <alloc::vec::Vec<T>>::extend_from_slice and <&'a T as core::fmt::Debug>::fmt.
While wasm2wat produces very nice looking output, I get a segmentation fault when feeding this output back into wat2wasm. I'm guessing that the space characters are causing issues when parsing the .wat file but other characters could be causing problems as well.
Ah, I see! Yeah, this seems to be a limitation of the text format, since any utf-8 sequence is allowed for a name in the binary format. For now, I guess wasm2wat should probably just produce a replacement character.
I wasn't able to repro the segfault though, here's what I tried:
Closing as this no longer segfaults or produces an error, although the question of roundtrippability, and the issue to be fixed by #1661, still seem outstanding.
Activity
binji commentedon Dec 3, 2017
Ah, I see! Yeah, this seems to be a limitation of the text format, since any utf-8 sequence is allowed for a name in the binary format. For now, I guess
wasm2watshould probably just produce a replacement character.I wasn't able to repro the segfault though, here's what I tried:
Replace invalid characters with `_` in wat-writer
Replace invalid characters with `_` in wat-writer
Replace invalid characters with `_` in wat-writer (#687)
keithw commentedon May 19, 2022
Closing as this no longer segfaults or produces an error, although the question of roundtrippability, and the issue to be fixed by #1661, still seem outstanding.