dsecurity49 opened PR #15108 from dsecurity49:fix-scratch-reg-clobber-stack-limit to bytecodealliance:main:
Fixes #14946
Avoids clobbering base and scratch registers on AArch64 and RISC-V when materializing large offsets that exceed immediate ranges (such as in nested stack limit checks). When the base or source register is already the default scratch register, select the secondary scratch register instead.
Includes precise-output compile filetests and unit tests.
dsecurity49 removed the review request for wasmtime-compiler-reviewers from PR #15108.
dsecurity49 requested wasmtime-compiler-reviewers for a review on PR #15108.
dsecurity49 requested cfallin for a review on PR #15108.
github-actions[bot] added the label cranelift:area:aarch64 on PR #15108.
github-actions[bot] added the label cranelift on PR #15108.
:memo: cfallin submitted PR review:
Thanks!
:speech_balloon: cfallin created PR review comment:
We generally don't write unit tests in Rust for specific emission cases like this -- can you try to formulate CLIF tests that trigger the new cases instead?
dsecurity49 updated PR #15108.
:memo: dsecurity49 submitted PR review.
:speech_balloon: dsecurity49 created PR review comment:
:+1:. I've removed the Rust unit tests and added CLIF filetests with precise output to
isa/riscv64/amodes.clifcovering large-offset loads, stores, andstack_addr.
:thumbs_up: cfallin submitted PR review.
cfallin added PR #15108 cranelift: avoid scratch register clobber in large-offset address mat… to the merge queue.
:check: cfallin merged PR #15108.
cfallin removed PR #15108 cranelift: avoid scratch register clobber in large-offset address mat… from the merge queue.
Last updated: Nov 19 2026 at 20:05 UTC