diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-04 21:17:10 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-04 21:17:10 -0800 |
commit | 9db25c0958470f3da763861967c842f42fd112c5 (patch) | |
tree | 07936dd8e978cf91bfe842664a325e85b67734ec /src | |
parent | 71447b6490106f5ce6c77ee882213aaac4548a35 (diff) | |
download | binaryen-9db25c0958470f3da763861967c842f42fd112c5.tar.gz binaryen-9db25c0958470f3da763861967c842f42fd112c5.tar.bz2 binaryen-9db25c0958470f3da763861967c842f42fd112c5.zip |
fix string parsing
Diffstat (limited to 'src')
-rw-r--r-- | src/wasm-s-parser.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index f9fa4e565..a49fa7bd5 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -160,13 +160,17 @@ private: Element* parseString() { if (input[0] == '$') input++; // names begin with $, but we don't need that internally + char *start = input; bool quoted = false; if (input[0] == '"') { quoted = true; + start++; + input = strchr(start, '"'); + assert(input); input++; + } else { + while (input[0] && !isspace(input[0]) && input[0] != ')') input++; } - char *start = input; - while (input[0] && !isspace(input[0]) && input[0] != ')') input++; char temp = input[0]; input[0] = 0; if (quoted) input[-1] = 0; |