Skip to content

Missing contref handling in VMArrayRef::read_elem #13021

@alexcrichton

Description

@alexcrichton

The contref top type isn't handled here. Wanted to file a tracking issue for this.

For example this test:

(module
  (type $ft (func))
  (type $ct (cont $ft))
  (type $arr (array (mut (ref null $ct))))
  (func (export "boom")
    (local $a (ref $arr))
    (local.set $a (array.new_default $arr (i32.const 2)))
    (array.copy $arr $arr
      (local.get $a) (i32.const 0)
      (local.get $a) (i32.const 0)
      (i32.const 1))
  )
)
(invoke "boom")

fails as:

$ wasmtime wast testcase.wast -W stack-switching,function-references,gc -C collector=null

thread 'main' (402739) panicked at crates/wasmtime/src/runtime/vm/gc/enabled/arrayref.rs:182:30:
internal error: entered unreachable code: not a top type: Cont
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
zsh: IOT instruction (core dumped)  wasmtime wast testcase.wast -W stack-switching,function-references,gc -C

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions