Skip to content

Commit eae22f6

Browse files
authored
[test] Add test for malformed functype (#1254)
1 parent 6330e5b commit eae22f6

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

test/core/binary.wast

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@
5252
(assert_malformed (module binary "\00asm" "\01\00\00\00" "\ff\00\01\00") "malformed section id")
5353

5454

55+
;; Type section with signed LEB128 encoded type
56+
(assert_malformed
57+
(module binary
58+
"\00asm" "\01\00\00\00"
59+
"\01" ;; Type section id
60+
"\05" ;; Type section length
61+
"\01" ;; Types vector length
62+
"\e0\7f" ;; Malformed functype, -0x20 in signed LEB128 encoding
63+
"\00\00"
64+
)
65+
"integer representation too long"
66+
)
67+
68+
5569
;; call_indirect reserved byte equal to zero.
5670
(assert_malformed
5771
(module binary

0 commit comments

Comments
 (0)