summaryrefslogtreecommitdiff
path: root/test/spec/elem.txt
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2021-12-02 17:30:09 -0800
committerGitHub <noreply@github.com>2021-12-02 17:30:09 -0800
commit0dfa83c1bc645eaa65d8e6ee51f42f8578931ecc (patch)
tree976045d56346480584f4c91eea47e7bd808db2a1 /test/spec/elem.txt
parent952560950f176913c1f54525f250e30d26c2b49a (diff)
downloadwabt-0dfa83c1bc645eaa65d8e6ee51f42f8578931ecc.tar.gz
wabt-0dfa83c1bc645eaa65d8e6ee51f42f8578931ecc.tar.bz2
wabt-0dfa83c1bc645eaa65d8e6ee51f42f8578931ecc.zip
Perform init expression validation outside of the binary reader. NFC (#1770)
Rather than spocial casing them in the reader we now use the same instruction callbacks for instruction that appear in init expressions as instructions that appear in normal functions. The result of this change is the validation of init expressions is pushed further up the stack. For example, objdump will now quite happily dump modules that use arbitrary instructions in thier init expressions even though they are not valid. To me, this makes sense since objdump does not do instruction validation elsewhere. The change is pre-cursor to allowing a wider variety of instruction to be present in init expressions. See https://github.com/WebAssembly/extended-const
Diffstat (limited to 'test/spec/elem.txt')
-rw-r--r--test/spec/elem.txt27
1 files changed, 18 insertions, 9 deletions
diff --git a/test/spec/elem.txt b/test/spec/elem.txt
index 25bfc27d..a2872f9d 100644
--- a/test/spec/elem.txt
+++ b/test/spec/elem.txt
@@ -7,26 +7,35 @@ out/test/spec/elem.wast:336: assert_invalid passed:
0000000: error: table variable out of range: 0 (max 0)
0000016: error: BeginElemSegment callback failed
out/test/spec/elem.wast:346: assert_invalid passed:
- 0000014: error: expected i32 init_expr
+ error: invalid elem segment offset, must be a constant expression; either i32.const or global.get.
+ 0000015: error: EndElemSegmentInitExpr callback failed
out/test/spec/elem.wast:354: assert_invalid passed:
- 0000014: error: expected i32 init_expr
+ error: invalid elem segment offset, must be a constant expression; either i32.const or global.get.
+ 0000015: error: EndElemSegmentInitExpr callback failed
out/test/spec/elem.wast:362: assert_invalid passed:
error: invalid elem segment offset, must be a constant expression; either i32.const or global.get.
0000013: error: EndElemSegmentInitExpr callback failed
out/test/spec/elem.wast:370: assert_invalid passed:
- 0000015: error: expected END opcode after initializer expression
+ error: expected END opcode after initializer expression
+ 0000016: error: OnI32ConstExpr callback failed
out/test/spec/elem.wast:378: assert_invalid passed:
- 000002b: error: expected END opcode after initializer expression
+ error: expected END opcode after initializer expression
+ 000002c: error: OnGlobalGetExpr callback failed
out/test/spec/elem.wast:387: assert_invalid passed:
- 000002b: error: expected END opcode after initializer expression
+ error: expected END opcode after initializer expression
+ 000002c: error: OnI32ConstExpr callback failed
out/test/spec/elem.wast:397: assert_invalid passed:
- 0000015: error: expected END opcode after initializer expression
+ error: Unepxected opcode in init expr
+ 0000015: error: OnUnaryExpr callback failed
out/test/spec/elem.wast:405: assert_invalid passed:
- 0000013: error: unexpected opcode in initializer expression: 0x1
+ error: Unepxected opcode in init expr
+ 0000013: error: OnNopExpr callback failed
out/test/spec/elem.wast:413: assert_invalid passed:
- 0000013: error: unexpected opcode in initializer expression: 0x1
+ error: Unepxected opcode in init expr
+ 0000013: error: OnNopExpr callback failed
out/test/spec/elem.wast:421: assert_invalid passed:
- 0000015: error: expected END opcode after initializer expression
+ error: Unepxected opcode in init expr
+ 0000015: error: OnNopExpr callback failed
out/test/spec/elem.wast:435: assert_invalid passed:
0000000: error: global variable out of range: 0 (max 0)
error: initializer expression cannot reference a mutable global