Similar to an earlier issue for ordinary branches (fixed in PR #1833), the cranelift-wasm crate did not previously correctly translate a br_table instruction's default-target branch when the branch target was a loop with loop parameters. The mistranslated CLIF resulted in a validation error. This one-line fix simply fills in the correct parameter count, generating a jump instruction with the appropriate parameters from the stack. This issue was found by :decoder in the SpiderMonkey embedding of Cranelift, in https://bugzilla.mozilla.org/show_bug.cgi?id=1657062. The test case is from that bug report.
This crate performs the translation from a wasm module in binary format to the in-memory form of the Cranelift IR.
If you're looking for a complete WebAssembly implementation that uses this library, see Wasmtime.