Skip to content

[stdlib] fix some unsafe errors #82828

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
merged 1 commit into from
Jul 7, 2025

Conversation

glessard
Copy link
Contributor

@glessard glessard commented Jul 7, 2025

Fix incorrect uses of MutableSpan's and MutableRawSpan's internal _start() functions. Either using the _pointer stored property is the safe approach, or some other precondition was missing.

Addresses #82829

@glessard glessard requested a review from a team as a code owner July 7, 2025 05:53
@glessard
Copy link
Contributor Author

glessard commented Jul 7, 2025

@swift-ci please smoke test

@glessard glessard requested a review from benrimmington July 7, 2025 05:54
@benrimmington
Copy link
Contributor

I found 4 other APIs with similar issues:

@glessard glessard force-pushed the mutableSpan-extractingBug branch from 072b9aa to 9ac65cf Compare July 7, 2025 09:30
@glessard
Copy link
Contributor Author

glessard commented Jul 7, 2025

Also MutableSpan.withUnsafeMutableBytes(), and some missing unsafe annotations. (Updated #82829.)

@glessard
Copy link
Contributor Author

glessard commented Jul 7, 2025

@swift-ci please smoke test

@glessard
Copy link
Contributor Author

glessard commented Jul 7, 2025

@swift-ci please smoke test linux platform

@glessard glessard changed the title [stdlib] fix an unsafe error [stdlib] fix some unsafe errors Jul 7, 2025
Copy link
Contributor

@Catfish-Man Catfish-Man left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@glessard glessard merged commit 9d17971 into swiftlang:main Jul 7, 2025
3 checks passed
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.

3 participants