Skip to content

Commit

Permalink
Add test for function without an end marker. NFC
Browse files Browse the repository at this point in the history
The function in this test end with a `drop` and is
otherwise well-formed but doesn't include the end
marker.
  • Loading branch information
sbc100 committed Dec 13, 2021
1 parent 2460ad0 commit 2a5b157
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/core/binary.wast
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,25 @@
"integer too large"
)

;; Function with missing end marker
(assert_malformed
(module binary
"\00asm" "\01\00\00\00"
"\03\02\01\00" ;; Function section
"\0a\06\02" ;; Code section with 2 functions
;; function 0
"\04\00" ;; Function size and local type count
"\41\01" ;; i32.const 1
"\1a" ;; drop
;; Missing end marker here
;; function 1
"\05\00" ;; Function size and local type count
"\41\01" ;; i32.const 1
"\1a" ;; drop
"\0b" ;; end
)
"END opcode expected"
)

;; Unsigned LEB128 must not be overlong
(assert_malformed
Expand Down

0 comments on commit 2a5b157

Please sign in to comment.