From 8a1f1de079e9098df8ba2f51c108ea63f9707106 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Tue, 5 Jul 2016 10:26:00 -0700 Subject: add parse error on array misindexing --- src/wasm-s-parser.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/wasm-s-parser.h') diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index b31b727b7..a48ee1a5f 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -78,6 +78,7 @@ public: } Element* operator[](unsigned i) { + if (i >= list().size()) throw ParseException("expected more elements in list", line, col); return list()[i]; } -- cgit v1.2.3