jeffcharles opened PR #7494 from jeffcharles:winch-spilled-floats-fix
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
-->
I observed an assertion failure ofassertion failed: self.sp_offset == locals_size
in theepilogue
function when there's a float on the value stack and a spill is triggered when using Winch. When we spill, we use the scratch register which results in 8 bytes being allocated on the stack and when we pop the float to return that value, we only free 4 bytes because it's a float. This changes the spilling behaviour to use a floating point scratch register instead so we increment the stack by the same amount we will decrement it by when popping the function result.
jeffcharles requested fitzgen for a review on PR #7494.
jeffcharles requested wasmtime-compiler-reviewers for a review on PR #7494.
saulecabrera submitted PR review:
Looks good to me, thanks! FWIW (as discussed offline) as part of my work on multi-value I'm changing the push/pop behaviour to be type-sized. But this change is good enough to address the bug.
saulecabrera merged PR #7494.
Last updated: Oct 23 2024 at 20:03 UTC