Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions interpreter/valid/valid.ml
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ let rec check_instr (c : context) (e : instr) (s : infer_resulttype) : infer_ins
require (i < Lib.List32.length fts) e.at
("unknown field " ^ I32.to_string_u i);
let FieldT (mut, st) = Lib.List32.nth fts i in
require (mut == Var) e.at "field is immutable";
require (mut == Var) e.at "immutable field";
let t = unpacked_storagetype st in
[RefT (Null, UseHT (Def (type_ c x))); t] --> [], []

Expand Down Expand Up @@ -811,7 +811,7 @@ let rec check_instr (c : context) (e : instr) (s : infer_resulttype) : infer_ins

| ArraySet x ->
let FieldT (mut, st) = array_type c x in
require (mut == Var) e.at "array is immutable";
require (mut == Var) e.at "immutable array";
let t = unpacked_storagetype st in
[RefT (Null, UseHT (Def (type_ c x))); NumT I32T; t] --> [], []

Expand All @@ -821,19 +821,19 @@ let rec check_instr (c : context) (e : instr) (s : infer_resulttype) : infer_ins
| ArrayCopy (x, y) ->
let FieldT (mutd, std) = array_type c x in
let FieldT (_muts, sts) = array_type c y in
require (mutd = Var) e.at "array is immutable";
require (mutd = Var) e.at "immutable array";
require (match_storagetype c.types sts std) e.at "array types do not match";
[RefT (Null, UseHT (Def (type_ c x))); NumT I32T; RefT (Null, UseHT (Def (type_ c y))); NumT I32T; NumT I32T] --> [], []

| ArrayFill x ->
let FieldT (mut, st) = array_type c x in
require (mut = Var) e.at "array is immutable";
require (mut = Var) e.at "immutable array";
let t = unpacked_storagetype st in
[RefT (Null, UseHT (Def (type_ c x))); NumT I32T; t; NumT I32T] --> [], []

| ArrayInitData (x, y) ->
let FieldT (mut, st) = array_type c x in
require (mut = Var) e.at "array is immutable";
require (mut = Var) e.at "immutable array";
let () = data c y in
let t = unpacked_storagetype st in
require (is_numtype t || is_vectype t) x.at
Expand All @@ -842,7 +842,7 @@ let rec check_instr (c : context) (e : instr) (s : infer_resulttype) : infer_ins

| ArrayInitElem (x, y) ->
let FieldT (mut, st) = array_type c x in
require (mut = Var) e.at "array is immutable";
require (mut = Var) e.at "immutable array";
let rt = elem c y in
require (match_valtype c.types (RefT rt) (unpacked_storagetype st)) x.at
("type mismatch: element segment's type " ^ string_of_reftype rt ^
Expand Down
4 changes: 2 additions & 2 deletions test/core/exceptions/tag.wast
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@
)
(tag (import "M" "tag") (type $t2))
)
"incompatible import"
"incompatible import type"
)

(assert_unlinkable
(module
(type $t (func))
(tag (import "M" "tag") (type $t))
)
"incompatible import"
"incompatible import type"
)
2 changes: 1 addition & 1 deletion test/core/gc/array.wast
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
(array.set $a (local.get $a) (i32.const 0) (i64.const 1))
)
)
"array is immutable"
"immutable array"
)

(assert_invalid
Expand Down
2 changes: 1 addition & 1 deletion test/core/gc/array_copy.wast
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
(array.copy $a $b (local.get $1) (i32.const 0) (local.get $2) (i32.const 0) (i32.const 0))
)
)
"array is immutable"
"immutable array"
)

(assert_invalid
Expand Down
2 changes: 1 addition & 1 deletion test/core/gc/array_fill.wast
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
(array.fill $a (local.get $1) (i32.const 0) (local.get $2) (i32.const 0))
)
)
"array is immutable"
"immutable array"
)

(assert_invalid
Expand Down
2 changes: 1 addition & 1 deletion test/core/gc/array_init_data.wast
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
(array.init_data $a $d1 (local.get $1) (i32.const 0) (i32.const 0) (i32.const 0))
)
)
"array is immutable"
"immutable array"
)

(assert_invalid
Expand Down
2 changes: 1 addition & 1 deletion test/core/gc/array_init_elem.wast
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
(array.init_elem $a $e1 (local.get $1) (i32.const 0) (i32.const 0) (i32.const 0))
)
)
"array is immutable"
"immutable array"
)

(assert_invalid
Expand Down
2 changes: 1 addition & 1 deletion test/core/gc/struct.wast
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
(struct.set $s 0 (local.get $s) (i64.const 1))
)
)
"field is immutable"
"immutable field"
)


Expand Down
6 changes: 3 additions & 3 deletions test/core/return_call_indirect.wast
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,9 @@
;; return_call_indirect expects funcref type but receives externref
(assert_invalid
(module
(type (func))
(table 10 externref)
(func $return-call-indirect (return_call_indirect (type 0) (i32.const 0)))
(type (func))
(table 10 externref)
(func $return-call-indirect (return_call_indirect (type 0) (i32.const 0)))
)
"type mismatch"
)
Expand Down