Skip to content

Runtime demangler support for pack expansions [5.9] #67181

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

Conversation

slavapestov
Copy link
Contributor

  • Description: Type witnesses in witness tables are represented as a mangled string which is passed in to the runtime demangler. The type witness can reference the generic parameters of the conforming type in the general case; if any of these generic parameters are packs, the type witness can contain pack expansions. Implement support for pack expansion types in the runtime demangler, when they appear inside tuples, function type parameter lists, and nominal type generic argument lists.

  • Scope of the issue: If you conform a variadic nominal type to a protocol and witnessed an associated type requirement with a type involving a pack expansion, you would crash. Also, the Swift runtime exports public entry points for calling into the demangler from framework code.

  • Risk: Only affects code that uses parameter packs, other than a small refactoring to handling of tuple labels.

  • Radar: rdar://111694735

  • Reviewed by: @hborla

@slavapestov slavapestov requested a review from a team as a code owner July 7, 2023 18:24
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov force-pushed the runtime-pack-expansion-demangling-5.9 branch from 0379251 to 766065e Compare July 7, 2023 19:47
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test Linux

@slavapestov slavapestov force-pushed the runtime-pack-expansion-demangling-5.9 branch from 766065e to b6e3f2a Compare July 7, 2023 23:12
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@slavapestov slavapestov merged commit 5efec1c into swiftlang:release/5.9 Jul 8, 2023
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