Skip to content

Commit f93a379

Browse files
committed
Merge branch 'main' of github.com:WebAssembly/spec into wasmfx-merge
2 parents 51ddedf + 8ea273d commit f93a379

File tree

1 file changed

+114
-0
lines changed

1 file changed

+114
-0
lines changed

test/core/binary.wast

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,3 +953,117 @@
953953
)
954954
"unexpected content after last section"
955955
)
956+
957+
;; Multiple function sections
958+
(assert_malformed
959+
(module binary
960+
"\00asm" "\01\00\00\00"
961+
"\01\04\01\60\00\00" ;; Type section
962+
"\03\02\01\00" ;; Function section with 1 function
963+
"\03\02\01\00" ;; Function section with 1 function
964+
"\0a\07\02\02\00\0b\02\00\0b" ;; Code section with 2 empty functions
965+
)
966+
"unexpected content after last section"
967+
)
968+
969+
;; Multiple code sections
970+
(assert_malformed
971+
(module binary
972+
"\00asm" "\01\00\00\00"
973+
"\01\04\01\60\00\00" ;; Type section
974+
"\03\03\02\00\00" ;; Function section with 2 functions
975+
"\0a\04\01\02\00\0b" ;; Code section with 1 empty function
976+
"\0a\04\01\02\00\0b" ;; Code section with 1 empty function
977+
)
978+
"unexpected content after last section"
979+
)
980+
981+
;; Multiple data count sections
982+
(assert_malformed
983+
(module binary
984+
"\00asm" "\01\00\00\00"
985+
"\0c\01\01" ;; Datacount section with value "1"
986+
"\0c\01\01" ;; Datacount section with value "1"
987+
)
988+
"unexpected content after last section"
989+
)
990+
991+
;; Multiple data sections
992+
(assert_malformed
993+
(module binary
994+
"\00asm" "\01\00\00\00"
995+
"\0b\01\00" ;; Data section with zero entries
996+
"\0b\01\00" ;; Data section with zero entries
997+
)
998+
"unexpected content after last section"
999+
)
1000+
1001+
;; Multiple global sections
1002+
(assert_malformed
1003+
(module binary
1004+
"\00asm" "\01\00\00\00"
1005+
"\06\01\00" ;; Global section with zero entries
1006+
"\06\01\00" ;; Global section with zero entries
1007+
)
1008+
"unexpected content after last section"
1009+
)
1010+
1011+
;; Multiple export sections
1012+
(assert_malformed
1013+
(module binary
1014+
"\00asm" "\01\00\00\00"
1015+
"\07\01\00" ;; Export section with zero entries
1016+
"\07\01\00" ;; Export section with zero entries
1017+
)
1018+
"unexpected content after last section"
1019+
)
1020+
1021+
;; Multiple table sections
1022+
(assert_malformed
1023+
(module binary
1024+
"\00asm" "\01\00\00\00"
1025+
"\04\01\00" ;; Table section with zero entries
1026+
"\04\01\00" ;; Table section with zero entries
1027+
)
1028+
"unexpected content after last section"
1029+
)
1030+
1031+
;; Multiple element sections
1032+
(assert_malformed
1033+
(module binary
1034+
"\00asm" "\01\00\00\00"
1035+
"\09\01\00" ;; Element section with zero entries
1036+
"\09\01\00" ;; Element section with zero entries
1037+
)
1038+
"unexpected content after last section"
1039+
)
1040+
1041+
;; Multiple import sections
1042+
(assert_malformed
1043+
(module binary
1044+
"\00asm" "\01\00\00\00"
1045+
"\02\01\00" ;; Import section with zero entries
1046+
"\02\01\00" ;; Import section with zero entries
1047+
)
1048+
"unexpected content after last section"
1049+
)
1050+
1051+
;; Multiple type sections
1052+
(assert_malformed
1053+
(module binary
1054+
"\00asm" "\01\00\00\00"
1055+
"\01\01\00" ;; Type section with zero entries
1056+
"\01\01\00" ;; Type section with zero entries
1057+
)
1058+
"unexpected content after last section"
1059+
)
1060+
1061+
;; Multiple memory sections
1062+
(assert_malformed
1063+
(module binary
1064+
"\00asm" "\01\00\00\00"
1065+
"\05\01\00" ;; Memory section with zero entries
1066+
"\05\01\00" ;; Memory section with zero entries
1067+
)
1068+
"unexpected content after last section"
1069+
)

0 commit comments

Comments
 (0)