Skip to content

[6.2] ClosureSpecializer: don't specialize captures of stack-allocated Objective-C blocks #82560

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

eeckstein
Copy link
Contributor

@eeckstein eeckstein requested a review from a team as a code owner June 27, 2025 05:24
@eeckstein
Copy link
Contributor Author

@swift-ci test

…ctive-C blocks

Bail if the closure captures an ObjectiveC block which might _not_ be copied onto the heap, i.e optimized by SimplifyCopyBlock.
We can't do this because the optimization inserts retains+releases for captured arguments.
That's not possible for stack-allocated blocks.

Fixes a mis-compile
rdar://154241245
@eeckstein eeckstein force-pushed the fix-closure-specializer-6.2 branch from 56dfd61 to 9952649 Compare June 27, 2025 18:09
@eeckstein
Copy link
Contributor Author

@swift-ci test

@eeckstein eeckstein enabled auto-merge June 27, 2025 18:11
@eeckstein
Copy link
Contributor Author

@swift-ci test macos

3 similar comments
@eeckstein
Copy link
Contributor Author

@swift-ci test macos

@eeckstein
Copy link
Contributor Author

@swift-ci test macos

@eeckstein
Copy link
Contributor Author

@swift-ci test macos

@eeckstein eeckstein merged commit 8c47b59 into swiftlang:release/6.2 Jun 30, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants