Skip to content

Commit 924c1f8

Browse files
authored
[test] More tests for ill-typed call indirect (WebAssembly#1822)
1 parent 8012c48 commit 924c1f8

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/core/call_indirect.wast

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,15 @@
990990
"type mismatch"
991991
)
992992

993+
;; call_indirect expects funcref type but receives externref
994+
(assert_invalid
995+
(module
996+
(type (func))
997+
(table 10 externref)
998+
(func $call-indirect (call_indirect (type 0) (i32.const 0)))
999+
)
1000+
"type mismatch"
1001+
)
9931002

9941003
;; Unbound type
9951004

@@ -1008,6 +1017,20 @@
10081017
"unknown type"
10091018
)
10101019

1020+
;; pass very large number to call_indirect
1021+
(assert_invalid
1022+
(module
1023+
(type (func (param i32)))
1024+
(table 1 funcref)
1025+
(func $conditional-dangling-type
1026+
(if (i32.const 1)
1027+
(then (call_indirect (type 0xffffffff) (i32.const 0)))
1028+
)
1029+
)
1030+
)
1031+
"unknown type"
1032+
)
1033+
10111034

10121035
;; Unbound function in table
10131036

0 commit comments

Comments
 (0)