Skip to content

Panic with uncanonicalized types in components #1763

@abrown

Description

@abrown

Consider foo.wat, which refers to an undefined type index:

(component
  (core type (func (param (ref 0))))
)

Because types in components are unvalidated and never canonizalized, this kind of input makes it possible to panic wasm-tools:

$  wasm-tools --version
wasm-tools 1.206.0
$ wasm-tools validate foo.wat
thread 'main' panicked at /.../.cargo/registry/src/index.crates.io-6f17d22bba15001f/wasmparser-0.206.0/src/validator/types.rs:2543:49:
internal error: entered unreachable code
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions