Skip to content

[5.8][Runtime] Fix key paths on 32-bit with KVC string pointers in the top half of memory. #63308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

mikeash
Copy link
Contributor

@mikeash mikeash commented Jan 30, 2023

Cherry-pick #63302 to release/5.8.

Key paths can store an offset or a pointer in the same field. On 32-bit, the field is considered to be an offset when it's less than the 4kB zero page, and a pointer otherwise.

The check uses a signed comparison, so pointers in the top half of memory would look like negative offsets. Add a check that the offset is zero or positive to avoid this.

rdar://103886537

…e top half of memory.

Key paths can store an offset or a pointer in the same field. On 32-bit, the field is considered to be an offset when it's less than the 4kB zero page, and a pointer otherwise.

The check uses a signed comparison, so pointers in the top half of memory would look like negative offsets. Add a check that the offset is zero or positive to avoid this.

rdar://103886537
(cherry picked from commit 1f8acac)
@mikeash mikeash requested review from al45tair and tbkka January 30, 2023 21:02
@mikeash
Copy link
Contributor Author

mikeash commented Jan 30, 2023

@swift-ci please test

@mikeash
Copy link
Contributor Author

mikeash commented Jan 31, 2023

@swift-ci please test macos platform

@mikeash mikeash merged commit 74ab40b into swiftlang:release/5.8 Feb 1, 2023
@AnthonyLatsis AnthonyLatsis added the 🍒 release cherry pick Flag: Release branch cherry picks label May 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants