Skip to content

Conversation

Azoy
Copy link
Contributor

@Azoy Azoy commented Jul 17, 2025

When passing arguments to a key path subscript component, we put the arguments into pointer aligned memory. This is a problem when the argument itself has an alignment larger than the platform's pointer alignment. We may end up magically putting on correctly aligned memory, but in most cases we won't. Handle this issue here by putting down padding for these over aligned arguments and recording the amount of padding and what alignment the argument is. Types in Swift are guaranteed to have lower than 16 byte alignment on all current platforms, so 64 bit platforms only need to worry about the 16 byte case whereas 32 bit needs to handle 8 byte and 16 byte aligned arguments.

Resolves: rdar://155108633

@Azoy Azoy requested review from jckarter and lorentey July 17, 2025 23:10
@Azoy Azoy force-pushed the keypath-overaligned-arguments branch from 54faa4a to b8d3d03 Compare August 19, 2025 21:22
@Azoy
Copy link
Contributor Author

Azoy commented Aug 19, 2025

@swift-ci please test

@Azoy Azoy marked this pull request as ready for review August 19, 2025 21:23
@Azoy Azoy requested a review from a team as a code owner August 19, 2025 21:23
@Azoy
Copy link
Contributor Author

Azoy commented Aug 26, 2025

@swift-ci please test

1 similar comment
@Azoy
Copy link
Contributor Author

Azoy commented Aug 26, 2025

@swift-ci please test

@Azoy Azoy force-pushed the keypath-overaligned-arguments branch from 896093a to 9c3c4e6 Compare September 4, 2025 21:21
@Azoy
Copy link
Contributor Author

Azoy commented Sep 4, 2025

@swift-ci please test

3 similar comments
@Azoy
Copy link
Contributor Author

Azoy commented Sep 8, 2025

@swift-ci please test

@Azoy
Copy link
Contributor Author

Azoy commented Sep 9, 2025

@swift-ci please test

@Azoy
Copy link
Contributor Author

Azoy commented Sep 9, 2025

@swift-ci please test

@Azoy Azoy force-pushed the keypath-overaligned-arguments branch from 0e15206 to 1071451 Compare September 16, 2025 17:04
@Azoy
Copy link
Contributor Author

Azoy commented Sep 16, 2025

@swift-ci please test

@Azoy
Copy link
Contributor Author

Azoy commented Sep 18, 2025

@swift-ci please test

@Azoy
Copy link
Contributor Author

Azoy commented Sep 18, 2025

@swift-ci please test

@Azoy
Copy link
Contributor Author

Azoy commented Sep 23, 2025

@swift-ci please test

@Azoy
Copy link
Contributor Author

Azoy commented Sep 23, 2025

@swift-ci please test Linux

@Azoy
Copy link
Contributor Author

Azoy commented Sep 23, 2025

@swift-ci please test macOS

@Azoy
Copy link
Contributor Author

Azoy commented Sep 24, 2025

@swift-ci please test

@Azoy
Copy link
Contributor Author

Azoy commented Oct 1, 2025

@swift-ci please test Windows

@Azoy Azoy merged commit 6017659 into swiftlang:main Oct 2, 2025
5 checks passed
@Azoy Azoy deleted the keypath-overaligned-arguments branch October 2, 2025 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant