File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -1388,8 +1388,14 @@ impl FuncEnvironment<'_> {
13881388 | WasmHeapType :: ConcreteStruct ( _)
13891389 | WasmHeapType :: None => false ,
13901390
1391- // Wrong type hierarchy: cannot be an i31.
1392- WasmHeapType :: Extern | WasmHeapType :: NoExtern => false ,
1391+ // Despite being a different type hierarchy, this *could* be an
1392+ // `i31` if it is the result of
1393+ //
1394+ // (extern.convert_any (ref.i31 ...))
1395+ WasmHeapType :: Extern => true ,
1396+
1397+ // Can only ever be `null`.
1398+ WasmHeapType :: NoExtern => false ,
13931399
13941400 // Wrong type hierarchy, and also funcrefs are not GC-managed
13951401 // types. Should have been caught by the assertion at the start of
Original file line number Diff line number Diff line change 1+ ;; ! gc = true
2+
3+ (module
4+ (type (struct (field externref )))
5+ (func (export " " )
6+ i32.const 0x7fffffff
7+ ref.i31
8+ extern.convert_any
9+ struct.new 0
10+ drop
11+ )
12+ )
13+
14+ (assert_return (invoke " " ))
You can’t perform that action at this time.
0 commit comments