Skip to content

[lldb] Fix dynamic type resolution for ObjC protocol existentials #10033

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

augusto2112
Copy link

An existential whose protocol type is an Objective-C protocol is not passed in an existential container, but as a plain old instance pointer. This patch dynamic type resolution failing for those types.

rdar://144028358

@augusto2112 augusto2112 requested a review from a team as a code owner February 14, 2025 21:37
@augusto2112
Copy link
Author

@swift-ci test

@augusto2112
Copy link
Author

@swift-ci test

An existential whose protocol type is an Objective-C protocol is not
passed in an existential container, but as a plain old instance pointer.
This patch dynamic type resolution failing for those types.

rdar://144028358
@augusto2112
Copy link
Author

@swift-ci test

@@ -1575,22 +1575,47 @@ swift::Demangle::NodePointer TypeSystemSwiftTypeRef::GetDemangleTreeForPrinting(
return GetNodeForPrintingImpl(dem, node, flavor, resolve_objc_module);
}

/// Determine wether this demangle tree contains a node of kind \c kind.
/// Determine wether this demangle tree contains a node of kind \c kind and with
/// text \c text (if provided).
static bool Contains(swift::Demangle::NodePointer node,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Side note: this looks dangerous to me, since any type could appear in a parameter of a function type...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I don't understand the comment. How can this break with a function type?

@augusto2112 augusto2112 merged commit 2f72f06 into swiftlang:stable/20240723 Feb 18, 2025
3 checks passed
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