diff --git a/test/core/br.wast b/test/core/br.wast index 35f707c922..7a3ffdc687 100644 --- a/test/core/br.wast +++ b/test/core/br.wast @@ -655,3 +655,10 @@ (module (func $large-label (br 0x10000001))) "unknown label" ) + +;; Malformed: the index does not fit in u32 + +(assert_malformed + (module quote "(func (block (br 4294967296)))") + "i32 constant out of range" +) diff --git a/test/core/call.wast b/test/core/call.wast index e4f854f7a5..547c440847 100644 --- a/test/core/call.wast +++ b/test/core/call.wast @@ -516,3 +516,19 @@ (module (func $large-func (call 1012321300))) "unknown function" ) + +(assert_invalid + (module (func $max-func (call 4294967295))) + "unknown function" +) + +;; Malformed: the index does not fit in u32 + +(assert_malformed + (module quote "(func (call 4294967296))") + "i32 constant out of range" +) +(assert_malformed + (module quote "(func (call 0x1_0000_0000))") + "i32 constant out of range" +) diff --git a/test/core/gc/array.wast b/test/core/gc/array.wast index 81f943d211..cc56897495 100644 --- a/test/core/gc/array.wast +++ b/test/core/gc/array.wast @@ -326,6 +326,14 @@ "constant expression required" ) +(assert_malformed + (module quote + "(type $a (array i32))" + "(func (array.new_fixed $a 4294967296) drop)" + ) + "i32 constant out of range" +) + ;; Null dereference diff --git a/test/core/gc/struct.wast b/test/core/gc/struct.wast index d7740167a2..6713884aff 100644 --- a/test/core/gc/struct.wast +++ b/test/core/gc/struct.wast @@ -139,6 +139,14 @@ "immutable field" ) +(assert_malformed + (module quote + "(type $s (struct (field i32)))" + "(func (param (ref $s)) (struct.get $s 4294967296 (local.get 0)) drop)" + ) + "i32 constant out of range" +) + ;; Null dereference