From ca46b0772a8e7bb8d2237a27dcf538117842def4 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sat, 4 Jun 2016 11:37:08 -0700 Subject: if we start to parse an s-string and find it empty, that is invalid #570 (#571) --- src/wasm-s-parser.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index 633d8329e..8e7cf0775 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -243,6 +243,7 @@ private: return allocator.alloc()->setString(IString(str.c_str(), false), dollared)->setMetadata(line, start - lineStart); } while (input[0] && !isspace(input[0]) && input[0] != ')' && input[0] != '(' && input[0] != ';') input++; + if (start == input) throw ParseException("expected string", line, input - lineStart); char temp = input[0]; input[0] = 0; auto ret = allocator.alloc()->setString(IString(start, false), dollared)->setMetadata(line, start - lineStart); -- cgit v1.2.3