summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfedosgad <fedosgad@gmail.com>2024-11-04 19:51:27 +0300
committerGitHub <noreply@github.com>2024-11-04 08:51:27 -0800
commit81d6ac4a5d43c8329639bb88fc39f3ca6424896a (patch)
tree5aa694a4189fa46836bcf04c44199aa77a1ed66c
parentda297e0ebfcab3d8626ed18a87d51a84259e0e22 (diff)
downloadwabt-81d6ac4a5d43c8329639bb88fc39f3ca6424896a.tar.gz
wabt-81d6ac4a5d43c8329639bb88fc39f3ca6424896a.tar.bz2
wabt-81d6ac4a5d43c8329639bb88fc39f3ca6424896a.zip
wasm-decompile: Fix unescaped characters in data output. (#2500)
Characters `"` and `\` which have special meaning in data representations are not escaped by wasm-decompile and are passed to output as is. This PR fixes such incorrect behavior. All tests still pass (although no cases are added).
-rw-r--r--src/decompiler.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/decompiler.cc b/src/decompiler.cc
index cdb0a783..7881ce88 100644
--- a/src/decompiler.cc
+++ b/src/decompiler.cc
@@ -702,7 +702,7 @@ struct Decompiler {
size_t line_start = 0;
static const char s_hexdigits[] = "0123456789abcdef";
for (auto c : in) {
- if (c >= ' ' && c <= '~') {
+ if (c >= ' ' && c <= '~' && c != '"' && c != '\\') {
s += c;
} else {
s += '\\';