Skip to content

Conversation

@DougGregor
Copy link
Member

  • Explanation: When we have type system changes that affect name mangling and are usable on older platforms, we cannot use the demangle-to-metadata path for creating metadata for those types, because those older platforms will fail to demangle the type. Fix two instances of this: (1) Span et al are in a back-deployed dylib, so make sure we don't use mangling for them when deploying back to a pre-Swift 6.0 runtime due to inverse generics, and (2) nonisolated(nonsending) function types were introduced in Swift 6.2.
  • Scope: Only affect back-deployment when used with these new features.
  • Issues: rdar://155639204
  • Original PRs: [IRGen] Don't use mangled names for metadata including Span et al when back-deploying #83012
  • Risk: Low. These are new features, and the changes only take affect when back-deploying and using them together. This is also a well-trod path of falling back to metadata accessors rather than using demangling to get metadata.
  • Testing: CI + separate app back-deploying to iOS 17.
  • Reviewers: @slavapestov

…n back-deploying

If back-deploying prior to the introduction of name mangling and
runtime support for invertible constraints (~Copyable, ~Escapable),
don't use mangled names to access metadata. The code already existed
for this, but had a carve-out that still used mangled names for
standard library types that have always existed but got generalized to
support non-copyable & non-escapable types.

Tweak that carve-out to not apply to types like Span that come from a
back-deployment library. Fixes crashes when using metadata for Span et
al on older platforms.

Fixes rdar://155639204.
…uced in Swift 6.2

We can't use mangled named when back-deploying earlier.
@DougGregor DougGregor requested a review from a team as a code owner July 11, 2025 21:32
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor merged commit 47bb174 into swiftlang:release/6.2 Jul 14, 2025
5 checks passed
@DougGregor DougGregor deleted the no-mangled-name-span-metadata-6.2 branch July 14, 2025 15:37
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.

2 participants