Skip to content

Commit

Permalink
Merge branch 'main' of github.com:WebAssembly/gc into wasmfx-merge
Browse files Browse the repository at this point in the history
  • Loading branch information
dhil committed Dec 6, 2023
2 parents 2168ade + 0caaadc commit 50b8d7d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion interpreter/valid/valid.ml
Original file line number Diff line number Diff line change
Expand Up @@ -889,7 +889,7 @@ let rec check_instr (c : context) (e : instr) (s : infer_result_type) : infer_in
| ArrayCopy (x, y) ->
let ArrayT (FieldT (mutd, std)) = array_type c x in
let ArrayT (FieldT (_muts, sts)) = array_type c y in
require (mutd = Var) e.at "destination array is immutable";
require (mutd = Var) e.at "array is immutable";
require (match_storage_type c.types sts std) e.at "array types do not match";
[RefT (Null, DefHT (type_ c x)); NumT I32T; RefT (Null, DefHT (type_ c y)); NumT I32T; NumT I32T] --> [], []

Expand Down
16 changes: 8 additions & 8 deletions test/core/gc/array.wast
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@
(assert_return (invoke "set_get" (i32.const 1) (f32.const 7)) (f32.const 7))
(assert_return (invoke "len") (i32.const 3))

(assert_trap (invoke "get" (i32.const 10)) "out of bounds")
(assert_trap (invoke "set_get" (i32.const 10) (f32.const 7)) "out of bounds")
(assert_trap (invoke "get" (i32.const 10)) "out of bounds array access")
(assert_trap (invoke "set_get" (i32.const 10) (f32.const 7)) "out of bounds array access")

(module
(type $vec (array f32))
Expand Down Expand Up @@ -145,8 +145,8 @@
(assert_return (invoke "set_get" (i32.const 1) (f32.const 7)) (f32.const 7))
(assert_return (invoke "len") (i32.const 2))

(assert_trap (invoke "get" (i32.const 10)) "out of bounds")
(assert_trap (invoke "set_get" (i32.const 10) (f32.const 7)) "out of bounds")
(assert_trap (invoke "get" (i32.const 10)) "out of bounds array access")
(assert_trap (invoke "set_get" (i32.const 10) (f32.const 7)) "out of bounds array access")

(module
(type $vec (array i8))
Expand Down Expand Up @@ -190,8 +190,8 @@
(assert_return (invoke "set_get" (i32.const 1) (i32.const 7)) (i32.const 7))
(assert_return (invoke "len") (i32.const 3))

(assert_trap (invoke "get" (i32.const 10)) "out of bounds")
(assert_trap (invoke "set_get" (i32.const 10) (i32.const 7)) "out of bounds")
(assert_trap (invoke "get" (i32.const 10)) "out of bounds array access")
(assert_trap (invoke "set_get" (i32.const 10) (i32.const 7)) "out of bounds array access")

(module
(type $bvec (array i8))
Expand Down Expand Up @@ -249,8 +249,8 @@
(assert_return (invoke "set_get" (i32.const 0) (i32.const 1) (i32.const 1)) (i32.const 2))
(assert_return (invoke "len") (i32.const 2))

(assert_trap (invoke "get" (i32.const 10) (i32.const 0)) "out of bounds")
(assert_trap (invoke "set_get" (i32.const 10) (i32.const 0) (i32.const 0)) "out of bounds")
(assert_trap (invoke "get" (i32.const 10) (i32.const 0)) "out of bounds array access")
(assert_trap (invoke "set_get" (i32.const 10) (i32.const 0) (i32.const 0)) "out of bounds array access")

(assert_invalid
(module
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))
)
)
"destination array is immutable"
"array is immutable"
)

(assert_invalid
Expand Down

0 comments on commit 50b8d7d

Please sign in to comment.