jeffcharles opened PR #7478 from jeffcharles:winch-unreachable-reset-sp-offset to bytecodealliance:main:
<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
This is a fix for a fuzzer testcase triggering an assertion ofsp_offsetnot equalinglocals_sizewhere there was a function which had spilled a local and ended withunreachable. I've added a minimal reproduction of the test case as the filetestwith_spilled_local.wat. While investigating, it looks like something similar happens whenunreachableis the last instruction in aniffollowed by anelse(covered by the other filetest added). Havingreset_stackalso reset thesp_offsetclears up both assertion failures.
jeffcharles requested elliottt for a review on PR #7478.
jeffcharles requested wasmtime-compiler-reviewers for a review on PR #7478.
saulecabrera submitted PR review:
I left a minor comment the regarding an invariant that we should verify. After fixing it, we can land this.
saulecabrera submitted PR review:
I left a minor comment the regarding an invariant that we should verify. After fixing it, we can land this.
saulecabrera created PR review comment:
Can we also assert that
masm.sp_offset() - target_spequals the size of all theMemoryentries in the value stack that got dropped?
jeffcharles updated PR #7478.
jeffcharles requested saulecabrera for a review on PR #7478.
saulecabrera submitted PR review.
saulecabrera merged PR #7478.
Last updated: Dec 13 2025 at 19:03 UTC