Skip to content

Panic compiling composition adapter with async + task.return + indirect params #11726

@alexcrichton

Description

@alexcrichton

Given this WIT file:

package a:b;

interface x {
  record big {
    a1: big2,
    a2: big2,
    a3: big2,
    a4: big2,
  }
  record big2 {
    a1: big3,
    a2: big3,
    a3: big3,
    a4: big3,
  }
  record big3 {
    a1: u8,
    a2: u8,
    a3: u8,
    a4: u8,
  }
  indirect-result: async func() -> big;
}

world caller {
  import x;
}

world callee {
  export x;
}

the panic is triggered with:

$ wasm-tools component embed --async-callback --dummy-names legacy ./foo.wit --world callee | wasm-tools component new -o callee.wasm
$ wasm-tools component embed --async-callback --dummy-names legacy ./foo.wit --world caller | wasm-tools component new -o caller.wasm
$ wasm-tools compose caller.wasm -d callee.wasm -o composition.wasm --skip-validation
$ cargo run --features component-model-async compile composition.wasm -W component-model-async,component-model-error-context
...
thread 'main' panicked at crates/environ/src/fact/trampoline.rs:3909:50:
called `Option::unwrap()` on a `None` value
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions