dhil opened PR #14085 from dhil:switch-type-index to bytecodealliance:main:
I came across this bug whilst working on fixing the interaction between GC and stack switching. I have hoisted it here as tiny self-contained PR.
The translation of
switchwould erroneously decompose aModuleInternedTypeIndexand use itsu32representation to build aTypeIndex. The two index types map different spaces, consequently it is possible to cause a compiler crash (out of bounds on lookup) or worse a runtime crash (argument types mismatch).
dhil requested alexcrichton for a review on PR #14085.
dhil requested wasmtime-compiler-reviewers for a review on PR #14085.
dhil requested wasmtime-core-reviewers for a review on PR #14085.
:cross_mark: dhil closed without merge PR #14085.
dhil reopened PR #14085 from dhil:switch-type-index to bytecodealliance:main.
dhil updated PR #14085.
dhil updated PR #14085.
:thumbs_up: alexcrichton submitted PR review.
alexcrichton added PR #14085 [stack-switching] Fix type index conflation in translation of switch to the merge queue
:check: alexcrichton merged PR #14085.
alexcrichton removed PR #14085 [stack-switching] Fix type index conflation in translation of switch from the merge queue
Last updated: Aug 30 2026 at 09:07 UTC