Skip to content

Conversation

@DougGregor
Copy link
Member

@DougGregor DougGregor commented Jul 11, 2025

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.

While I'm here, also fix nonisolated(nonsending) function types, which have a similar issue because they were introduced in Swift 6.2.

Fixes rdar://155639204.

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor force-pushed the no-mangled-name-span-metadata branch from 03a299e to f79b003 Compare July 11, 2025 21:24
@DougGregor DougGregor requested review from hborla and xedin as code owners July 11, 2025 21:24
…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 force-pushed the no-mangled-name-span-metadata branch from f79b003 to badba55 Compare July 11, 2025 21:25
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor merged commit 3a54cf5 into swiftlang:main Jul 12, 2025
5 checks passed
@DougGregor DougGregor deleted the no-mangled-name-span-metadata branch July 12, 2025 14:51
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