diff --git a/test/core/call_indirect.wast b/test/core/call_indirect.wast index 79b8dc393e..74b5e8d2e8 100644 --- a/test/core/call_indirect.wast +++ b/test/core/call_indirect.wast @@ -990,6 +990,15 @@ "type mismatch" ) +;; call_indirect expects funcref type but receives externref +(assert_invalid + (module + (type (func)) + (table 10 externref) + (func $call-indirect (call_indirect (type 0) (i32.const 0))) + ) + "type mismatch" +) ;; Unbound type @@ -1008,6 +1017,20 @@ "unknown type" ) +;; pass very large number to call_indirect +(assert_invalid + (module + (type (func (param i32))) + (table 1 funcref) + (func $conditional-dangling-type + (if (i32.const 1) + (then (call_indirect (type 0xffffffff) (i32.const 0))) + ) + ) + ) + "unknown type" +) + ;; Unbound function in table