Skip to content

Commit 9f5356d

Browse files
authored
[test/interpreter] Extern convert as const expr (#1890)
1 parent 3532eed commit 9f5356d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

interpreter/valid/valid.ml

+3-2
Original file line numberDiff line numberDiff line change
@@ -1012,8 +1012,9 @@ let is_const (c : context) (e : instr) =
10121012
| Const _ | VecConst _
10131013
| Binary (Value.I32 I32Op.(Add | Sub | Mul))
10141014
| Binary (Value.I64 I64Op.(Add | Sub | Mul))
1015-
| RefNull _ | RefFunc _
1016-
| RefI31 | StructNew _ | ArrayNew _ | ArrayNewFixed _ -> true
1015+
| RefNull _ | RefFunc _ | RefI31
1016+
| StructNew _ | ArrayNew _ | ArrayNewFixed _
1017+
| ExternConvert _ -> true
10171018
| GlobalGet x -> let GlobalT (mut, _t) = global c x in mut = Cons
10181019
| _ -> false
10191020

test/core/gc/extern.wast

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
(type $st (struct))
44
(type $at (array i8))
55

6+
(global externref (extern.convert_any (ref.null any)))
7+
(global anyref (any.convert_extern (ref.null extern)))
8+
69
(table 10 anyref)
710

811
(elem declare func $f)

0 commit comments

Comments
 (0)