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
[SILGen] Fix a bug where the wrong convention was being used for computing the type of a closure thunk #73299
Conversation
computing the type of a closure thunk The ObjC selector family convention was being used instead of the C function type convention. rdar://127090209
@swift-ci please test |
@swift-ci please test |
lib/SIL/IR/SILFunctionType.cpp
Outdated
@@ -4109,6 +4109,19 @@ static CanSILFunctionType getUncachedSILFunctionTypeForConstant( | |||
} | |||
} | |||
|
|||
// The type of the native-to-foreign thunk for a swift closure. | |||
if (shouldStoreClangType(TC.getDeclRefRepresentation(constant)) && | |||
constant.isForeign && constant.hasClosureExpr()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you check the foreign + closure conditions first? They seem like they'll weed things out a lot more than the shouldStoreClangType condition, which I guess is just future-proofing against other kinds of foreign reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@swift-ci please test |
The ObjC selector family convention was being used instead of the C function type convention.
rdar://127090209