Copy byval argument to local stackslot if alignment is insufficient#1641
Merged
bjorn3 merged 5 commits intorust-lang:mainfrom Apr 30, 2026
Merged
Copy byval argument to local stackslot if alignment is insufficient#1641bjorn3 merged 5 commits intorust-lang:mainfrom
bjorn3 merged 5 commits intorust-lang:mainfrom
Conversation
bjorn3
requested changes
Apr 13, 2026
bjorn3
requested changes
Apr 15, 2026
Member
|
I just found out that this doesn't actually fix #1465. It fixes a similar problem, but on the other side of the ABI. This fixes a problem on the callee when the ABI uses a lower alignment than the type needs, while #1465 is about copying on the caller side when the ABI requires a higher alignment than the type. The only tests in rust-lang/rust#122212 for the callee side bug only works on 32bit x86 which cg_clif doesn't support, so I can't actually test if your PR properly fixes the ABI mismatch. I do think it is correct, so I will merge it once CI passes. Thanks for working on this! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Copy the underaligned
byval(indirect) arguments into a local stackslot when the incoming pointer alignment is less than the Rust ABI alignment. This avoids miscompiles from assuming stronger alignment than the ABI guarantees.