diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-06 10:29:47 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-06 10:29:47 -0800 |
commit | 9a565d05ebafca5dd24ba4316af7efdfa0175a38 (patch) | |
tree | 9cd43957f39fddc16f78bce2c0ee8f7057aa6a64 | |
parent | 40a7faed41cfb05d7d877878e14a553457e284b1 (diff) | |
download | binaryen-9a565d05ebafca5dd24ba4316af7efdfa0175a38.tar.gz binaryen-9a565d05ebafca5dd24ba4316af7efdfa0175a38.tar.bz2 binaryen-9a565d05ebafca5dd24ba4316af7efdfa0175a38.zip |
parse escaped double-quotes
-rwxr-xr-x | check.py | 2 | ||||
-rw-r--r-- | src/wasm-s-parser.h | 8 |
2 files changed, 7 insertions, 3 deletions
@@ -84,7 +84,7 @@ if len(requested) == 0: # 'address' : filed issue, test looks invalid # 'exports', 'int_literals' : has a "return" https://github.com/WebAssembly/spec/issues/164 # 'switch': todo once stable - spec_tests = [os.path.join('spec', t + '.wast') for t in ['conversions', 'endianness', 'f32_cmp', 'f32', 'f64_cmp', 'f64', 'float_exprs', 'forward', 'func_ptrs', 'functions', 'has_feature', 'i32', 'i64', 'imports', 'int_exprs', 'left-to-right', 'memory_redundancy', 'memory_trap']] + spec_tests = [os.path.join('spec', t + '.wast') for t in ['conversions', 'endianness', 'f32_cmp', 'f32', 'f64_cmp', 'f64', 'float_exprs', 'forward', 'func_ptrs', 'functions', 'has_feature', 'i32', 'i64', 'imports', 'int_exprs', 'left-to-right', 'memory_redundancy', 'memory_trap', 'names']] else: spec_tests = requested[:] diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index 58f316075..969175f8a 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -183,8 +183,12 @@ private: bool quoted = false; if (input[0] == '"') { quoted = true; - start++; - input = strchr(start, '"'); + while (1) { + start++; + input = strchr(start, '"'); + assert(input); + if (input[-1] != '\\') break; + } assert(input); input++; } else { |