Skip to content

[stdlib, 6.2] Make String.makeContiguousUTF8() strictly true #82896

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

glessard
Copy link
Contributor

@glessard glessard commented Jul 8, 2025

  • Explanation:
    Until now, StringProtocol.makeContiguousUTF8() only considered whether or not a String or Substring heap allocation contained contiguous UTF8, disregarding whether a stack-allocated instance was discontiguous. This is no longer tenable when these types vend UTF8Span and Span properties, so we now also consider whether the small string form contains contiguous code units. If the small form contains discontiguously-stored code units, then it is replaced by a new heap-allocated String in contiguous storage. This new code path is specific to ABI-stable, 32-bit platforms.

  • Resolves: rdar://154331399

  • Risk: Low. This change is only in @_alwaysEmitIntoClient code.

  • Main branch PR: [stdlib] Make String.makeContiguousUTF8() strictly true #82851

  • Review by: @kperryua

  • Testing: new test, existing tests

@glessard glessard added 32 bit only 🍒 release cherry pick Flag: Release branch cherry picks swift 6.2 labels Jul 8, 2025
@glessard
Copy link
Contributor Author

glessard commented Jul 8, 2025

@swift-ci please test

@glessard glessard marked this pull request as ready for review July 8, 2025 22:43
@glessard glessard requested a review from a team as a code owner July 8, 2025 22:43
@glessard glessard merged commit b781244 into swiftlang:release/6.2 Jul 9, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants