Skip to content

Commit 4447fc1

Browse files
committed
[test] align.wast: add tests of malformed memop flags in wasm-3.0
1 parent 19ae75b commit 4447fc1

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

test/core/align.wast

+38
Original file line numberDiff line numberDiff line change
@@ -962,3 +962,41 @@
962962
)
963963
"type mismatch"
964964
)
965+
966+
;; memop flags >= 0x80
967+
(assert_malformed
968+
(module binary
969+
"\00asm" "\01\00\00\00"
970+
"\01\04\01\60\00\00" ;; Type section: 1 type
971+
"\03\02\01\00" ;; Function section: 1 function
972+
"\05\03\01\00\01" ;; Memory section: 1 memory
973+
"\0a\0b\01" ;; Code section: 1 function
974+
975+
;; function 0
976+
"\09\00"
977+
"\41\00" ;; i32.const 0
978+
"\28\80\01\00" ;; i32.load offset=0 align="2**128" (malformed)
979+
"\1a" ;; drop
980+
"\0b" ;; end
981+
)
982+
"malformed memop flags"
983+
)
984+
985+
;; memop flags > 0xff (and & 0xff = 0)
986+
(assert_malformed
987+
(module binary
988+
"\00asm" "\01\00\00\00"
989+
"\01\04\01\60\00\00" ;; Type section: 1 type
990+
"\03\02\01\00" ;; Function section: 1 function
991+
"\05\03\01\00\01" ;; Memory section: 1 memory
992+
"\0a\0b\01" ;; Code section: 1 function
993+
994+
;; function 0
995+
"\09\00"
996+
"\41\00" ;; i32.const 0
997+
"\28\80\02\00" ;; i32.load offset=0 align="2**256" (malformed)
998+
"\1a" ;; drop
999+
"\0b" ;; end
1000+
)
1001+
"malformed memop flags"
1002+
)

0 commit comments

Comments
 (0)