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_offset
not equalinglocals_size
where 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 whenunreachable
is the last instruction in anif
followed by anelse
(covered by the other filetest added). Havingreset_stack
also reset thesp_offset
clears 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_sp
equals the size of all theMemory
entries 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 23 2024 at 12:05 UTC