Skip to content
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 #73336

Merged
merged 1 commit into from
May 3, 2024

Conversation

ahatanaka
Copy link
Contributor

The ObjC selector family convention was being used instead of the C function type convention.

rdar://127090209
(cherry picked from commit 428fe21)

…uting the type of a closure thunk (#73299)

The ObjC selector family convention was being used instead of the C
function type convention.

rdar://127090209
(cherry picked from commit 428fe21)
@ahatanaka ahatanaka requested a review from a team as a code owner April 30, 2024 01:56
@ahatanaka
Copy link
Contributor Author

@swift-ci please test

@ahatanaka
Copy link
Contributor Author

Explanation: Swift compiler incorrectly rejects a program in which a swift closure is passed to a C++ function that takes a pointer to a function taking a non-trivial C++ type (see the code in the regression test). This is caused by a bug where the ObjC selector family convention is used instead of the C function pointer convention to get the SIL function type.
Scope: The change I made impacts SILGen.
Original PR: #73299
Risk: Low.
Testing: Added a compiler test.
Reviewer: @rjmccall @DougGregor

@ahatanaka ahatanaka merged commit c0fae83 into release/6.0 May 3, 2024
5 checks passed
@ahatanaka ahatanaka deleted the closure-to-cxx-function-pointer-direct-6.0 branch May 3, 2024 00: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.

None yet

2 participants