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

Fix infinite loop when force casting NSError to CocoaError #5115

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

nnabeyang
Copy link
Contributor

This PR addresses an infinite loop issue that occurred when force casting NSError to CocoaError. The problem arose because _forceBridgeFromObjectiveC was calling _unconditionallyBridgeFromObjectiveC, and in turn, _unconditionallyBridgeFromObjectiveC was calling _forceBridgeFromObjectiveC, causing a recursive loop.

@nnabeyang nnabeyang force-pushed the fix-core_error-cast-infinit-loop branch from 0b3b469 to 8a3d11e Compare October 17, 2024 23:23
@parkera
Copy link
Contributor

parkera commented Oct 18, 2024

@swift-ci test

@parkera
Copy link
Contributor

parkera commented Oct 18, 2024

Thanks for this fix. We are strangely inconsistent about which bridging function is 'primary' for these types; sometimes it funnels to conditionally, sometimes unconditionally, sometimes none of the above.

@parkera parkera merged commit bf7369a into swiftlang:main Oct 18, 2024
2 of 3 checks passed
parkera pushed a commit to parkera/swift-corelibs-foundation that referenced this pull request Oct 18, 2024
@nnabeyang nnabeyang deleted the fix-core_error-cast-infinit-loop branch October 18, 2024 23:22
parkera added a commit that referenced this pull request Oct 22, 2024
…#5115) (#5116)

(cherry picked from commit bf7369a)

Co-authored-by: noriaki watanabe <nabeyang@gmail.com>
parkera pushed a commit to parkera/swift-corelibs-foundation that referenced this pull request Oct 22, 2024
parkera added a commit that referenced this pull request Oct 22, 2024
…#5115) (#5119)

(cherry picked from commit bf7369a)

Co-authored-by: noriaki watanabe <nabeyang@gmail.com>
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.

2 participants