Skip to content

[6.1] Assign fallback discriminators within top-level closures. #78566

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

DougGregor
Copy link
Member

  • Explanation: We recently enabled some checking in the non-asserts compiler to ensure that all closures and local entities get discriminators, the lack of which can cause miscompiles and compiler crashes. We found a case where we were never correctly assigning discriminators, which relates to uses of macros at the top level of code where some of the macro arguments involve closures. Assign discriminators in those cases.
  • Scope: Prevents a compiler assertion/crash by assigning closure/macro discriminators for closures that appear at the top level.
  • Original PR: Assign fallback discriminators within top-level closures. #78565
  • Issue: rdar://142425569
  • Risk: Very very low. We're assigning a discriminator in a place that otherwise would have any, and these aren't ABI-stable.
  • Testing: Updated tests.

@DougGregor DougGregor requested a review from a team as a code owner January 10, 2025 23:12
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor merged commit 9356ce9 into swiftlang:release/6.1 Jan 11, 2025
5 checks passed
@DougGregor DougGregor deleted the top-level-closure-macro-discriminators-6.1 branch January 11, 2025 16:31
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