Skip to content

Interpreter panics on Br instruction when building with panic=unwind on recent nightly #5157

Description

@connyay

rust-lang/rust#156061 (landed in nightly-2026-05-09) switched wasm targets to modern exception handling (-wasm-use-legacy-eh=false). With panic=unwind, LLVM now wraps function bodies in try_table and emits br as the normal exit path, which the descriptor interpreter didn't handle.

  (block $outer
    (try_table (catch_all $outer)
      ;; descriptor code
      br $outer
    )
  )

The interpreter handles Block, Try, and TryTable but has no case for Br or BrIf, so they fall through to
the catch-all bail!("unknown instruction").

I observed this trying to use panic=unwind on the latest release of cloudflare/workers-rs:
https://github.com/connyay/cf-nats-ws/actions/runs/25973230210/job/76348826763#step:7:154

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions