summaryrefslogtreecommitdiff
path: root/test/lit/parse-bad-tuple-extract-index.wast
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2021-03-31 14:46:51 -0700
committerGitHub <noreply@github.com>2021-03-31 14:46:51 -0700
commit62b71e06eb69e00c9771d442ce7d2d93f3e03497 (patch)
tree4e3f4b4b8b75beccf0a21ffad37d8c88bfb2ea48 /test/lit/parse-bad-tuple-extract-index.wast
parentd9f0d8f09985320e0849f76d4ce8a8ee409f5e6d (diff)
downloadbinaryen-62b71e06eb69e00c9771d442ce7d2d93f3e03497.tar.gz
binaryen-62b71e06eb69e00c9771d442ce7d2d93f3e03497.tar.bz2
binaryen-62b71e06eb69e00c9771d442ce7d2d93f3e03497.zip
Catch bad tuple.extract index in parser (#3766)
Previously an out-of-bounds index would result in an out-of-bounds read during finalization of the tuple.extract expression.
Diffstat (limited to 'test/lit/parse-bad-tuple-extract-index.wast')
-rw-r--r--test/lit/parse-bad-tuple-extract-index.wast16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/lit/parse-bad-tuple-extract-index.wast b/test/lit/parse-bad-tuple-extract-index.wast
new file mode 100644
index 000000000..01974fe7e
--- /dev/null
+++ b/test/lit/parse-bad-tuple-extract-index.wast
@@ -0,0 +1,16 @@
+;; Test that out-of-bounds tuple.extract indices produce parse errors.
+
+;; RUN: not wasm-opt %s 2>&1 | filecheck %s
+
+;; CHECK: [parse exception: Bad index on tuple.extract (at 9:17)]
+
+(module
+ (func
+ (tuple.extract 2
+ (tuple.make
+ (i32.const 0)
+ (i64.const 1)
+ )
+ )
+ )
+)