Skip to content

Commit

Permalink
[test] Data count without data segment (#1801)
Browse files Browse the repository at this point in the history
  • Loading branch information
SoniEx2 committed Sep 12, 2024
1 parent a6a6b9a commit 4e722fb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/core/binary.wast
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,28 @@
"\01\00") ;; Passive data section
"data count and data section have inconsistent lengths")

;; Data count section without data segment section
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
"\01\04\01\60\00\00" ;; Type section: 1 type
"\03\02\01\00" ;; Function section: 1 function
"\05\03\01\00\01" ;; Memory section: 1 memory
"\08\01\00" ;; Start section: function 0
"\0c\01\01" ;; Data Count section: 1 segment
"\0a\0e\01" ;; Code section: 1 function

;; function 0
"\0c\00"
"\41\00" ;; i32.const 0
"\41\00" ;; i32.const 0
"\41\00" ;; i32.const 0
"\fc\08\00\00" ;; memory.init dataidx=0 memidx=0
"\0b" ;; end
)
"data count and data section have inconsistent lengths"
)

;; memory.init requires a datacount section
(assert_malformed
(module binary
Expand Down

0 comments on commit 4e722fb

Please sign in to comment.