alexcrichton requested wasmtime-compiler-reviewers for a review on PR #10819.
alexcrichton opened PR #10819 from alexcrichton:fix-rip-relative-addressing to bytecodealliance:main:
This commit fixes a bug in the new assembler which was surfaced through the changes in #10782 but was a pre-existing issue. Specifically the encoding of a RIP-relative addressing mode required knowing the number of bytes at the end of an instruction but this was accidentally hardcoded to 0. In #10782
imulinstructions were added where a RIP-relative address mode can be used in conjunction with an immediate which cause the RIP-relative addressing to load from the wrong address.This bug can in theory affect other instructions in the new assembler as well, but auditing the list of instructions it looks like
imulis the only one that can possibly have an immediate after a RIP-relative addressing mode. That means that prior instructions using the new assembler should not be affected.<!--
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
-->
alexcrichton requested abrown for a review on PR #10819.
abrown submitted PR review:
LGTM!
abrown submitted PR review:
LGTM! (Though it looks like something will need to change relative to pretty-printing...)
alexcrichton updated PR #10819.
alexcrichton commented on PR #10819:
@abrown mind double-checking the last commit I just added?
abrown submitted PR review:
Yeah, there must surely be a different way to sort this all out but this is great for now.
abrown created PR review comment:
/// of the offset, is added to what's already present in the encoding buffer.
abrown created PR review comment:
/// pretend the label is found at the end of the `buf`. That means that the
abrown created PR review comment:
/// distance from the label to the end of `buf` minus 4, which is the width
alexcrichton updated PR #10819.
alexcrichton has enabled auto merge for PR #10819.
alexcrichton merged PR #10819.
Last updated: Dec 06 2025 at 07:03 UTC