-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Fix problems with pseudogeneric thunks (3.0) #4823
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
Fix problems with pseudogeneric thunks (3.0) #4823
Conversation
slavapestov
commented
Sep 16, 2016
- Description: There were some issues with bridging blocks taking other blocks as inputs in generic context. I believe all of these are regressions in 3.0.
- Scope of the issue: Anybody writing code interoperating with Objective-C could be affected.
- Risk: Medium, the code here is tricky.
- Tested: New tests added.
- Radar: rdar://problem/27718566
50a234f
to
1e6f553
Compare
@jckarter Do you mind reviewing this? |
@swift-ci Please test |
Build failed |
Build failed |
1e6f553
to
22fd17a
Compare
@swift-ci Please test |
1 similar comment
@swift-ci Please test |
Build failed |
Pseudogeneric functions do not have runtime type metadata in their closure context, so don't try to emit metadata sources in the capture descriptor for reflection. Also, erase generic type parameters in capture types down to AnyObject, since the reflection library won't be able to substitute them.
This would manifest as crashes in IRGen when bridging a block taking another block in generic context. - When emitting a re-abstraction thunk, make it pseudogeneric if its parent function is pseudogeneric. This ensures we don't try to get runtime type metadata when it doesn't exist. - Mangle pseudogeneric-ness of a reabstraction thunk correctly. Otherwise we could emit thunks with different signatures under the same mangling. - Only set the pseudogeneric attribute if the thunk has a generic signature, since otherwise the mangling is no longer unique. Fixes <rdar://problem/27718566>.
22fd17a
to
fb073be
Compare
@swift-ci Please test |
1 similar comment
@swift-ci Please test |
Build failed |
@slavapestov this fails on the iOS simulator:
|
Looks good, thanks for fixing this @slavapestov! |
Thanks guys 😍 |
@swift-ci Please test macOS |
@swift-ci Please test |