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