Skip to content

🍒[cxx-interop] Do not expose enums with optional generic cases #74987

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

Xazax-hun
Copy link
Contributor

@Xazax-hun Xazax-hun commented Jul 5, 2024

Explanation:
The code path trying to generate the C++ header for enums that have cases with associated values of a generic optional type resulted in null pointer dereference. The proper fix is a bit more involved so this PR just temporarily avoids exposing the problematic enums to C++.
Scope: C++ Reverse Interop
Risk: Low, we stop exposing enums that were crashing the compiler before. Testing: Added a regression test.
Issue: rdar://129250756
Reviewer: @egorzhdan
Original PR: #74966

@Xazax-hun Xazax-hun added the c++ interop Feature: Interoperability with C++ label Jul 5, 2024
@Xazax-hun Xazax-hun requested a review from a team as a code owner July 5, 2024 10:16
@Xazax-hun Xazax-hun requested a review from egorzhdan July 5, 2024 10:16
@Xazax-hun
Copy link
Contributor Author

@swift-ci please test

@Xazax-hun Xazax-hun force-pushed the gaborh/stop-exporting-optional-generics-cherry-pick branch from 2b60276 to 474b6fa Compare July 5, 2024 15:52
@Xazax-hun
Copy link
Contributor Author

@swift-ci please test

@Xazax-hun Xazax-hun enabled auto-merge July 5, 2024 15:57
@Xazax-hun Xazax-hun force-pushed the gaborh/stop-exporting-optional-generics-cherry-pick branch from 474b6fa to f6b8524 Compare July 8, 2024 10:26
@Xazax-hun
Copy link
Contributor Author

@swift-ci please test

There was a failure due to differences in this test file between main and release/6.0. Attempting to fix.

@Xazax-hun
Copy link
Contributor Author

@swift-ci please test

Explanation:
The code path trying to generate the C++ header for enums that have
cases with associated values of a generic optional type resulted in null
pointer dereference. The proper fix is a bit more involved so this PR
just temporarily avoids exposing the problematic enums to C++.
Scope: C++ Reverse Interop
Risk: Low, we stop exposing enums that were crashing the compiler before.
Testing: Added a regression test.
Issue: rdar://129250756
Reviewer: @egorzhdan
Original PR: #74966
@Xazax-hun Xazax-hun force-pushed the gaborh/stop-exporting-optional-generics-cherry-pick branch from f6b8524 to 56b82bd Compare July 8, 2024 15:15
@Xazax-hun
Copy link
Contributor Author

@swift-ci please test

@Xazax-hun Xazax-hun merged commit cf183ac into release/6.0 Jul 8, 2024
5 checks passed
@Xazax-hun Xazax-hun deleted the gaborh/stop-exporting-optional-generics-cherry-pick branch July 8, 2024 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants