diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-09-02 17:42:34 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-09-07 09:56:01 -0700 |
commit | 52b0fe21ad36ef0e81193d4418916dbec7352fa4 (patch) | |
tree | 11254677d2edab0c17697aba55138a83d88389fd /src/wasm-s-parser.h | |
parent | a07797f1b1264e60912a8c18cb673b829ae0d1a5 (diff) | |
download | binaryen-52b0fe21ad36ef0e81193d4418916dbec7352fa4.tar.gz binaryen-52b0fe21ad36ef0e81193d4418916dbec7352fa4.tar.bz2 binaryen-52b0fe21ad36ef0e81193d4418916dbec7352fa4.zip |
new validation checks for upcoming spec tests
Diffstat (limited to 'src/wasm-s-parser.h')
-rw-r--r-- | src/wasm-s-parser.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index 3d57c5ada..9abdea744 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -1402,9 +1402,10 @@ private: } void parseData(Element& s) { + if (!hasMemory) throw ParseException("data but no memory"); Index i = 1; Expression* offset; - if (s[i]->isList()) { + if (i < s.size() && s[i]->isList()) { // there is an init expression offset = parseExpression(s[i++]); } else { |