saulecabrera opened PR #12708 from saulecabrera:winch-improve-addressing-modes to bytecodealliance:main:
Prior to this commit, Winch's
Addressrepresentation relied on the general(reg, offset)form for offset-based addressing, leaving the materialization of the addressing mode to Cranelift. This approach led to the following bug found by the fuzzer:When offsets cannot be encoded as a 9-bit signed immediate offset or a 12-bit unsigned immediate offset with scaling, the offset must be loaded into a register and the addressing mode is transformed to its
(reg, reg)form. Cranelift's addressing mode materialization currently usesx16as a scratch register to load the offset; even though both Cranelift and Winch usex16as a scratch register, its usage is not in sync, therefore clobbers can happen.This commit improves addressing modes by requiring early materialization of addressing modes into their respective Cranelift variants.
<!--
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
-->
saulecabrera requested fitzgen for a review on PR #12708.
saulecabrera requested wasmtime-compiler-reviewers for a review on PR #12708.
saulecabrera requested wasmtime-core-reviewers for a review on PR #12708.
saulecabrera submitted PR review.
saulecabrera created PR review comment:
I removed this from the top-level
Addresssince it's only used here, which removes one level of indirection.
github-actions[bot] added the label winch on PR #12708.
github-actions[bot] commented on PR #12708:
Subscribe to Label Action
cc @saulecabrera
<details>
This issue or pull request has been labeled: "winch"Thus the following users have been cc'd because of the following labels:
- saulecabrera: winch
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
Last updated: Mar 23 2026 at 16:19 UTC