Skip to content

[lldb] Handle unsupported type in GetPointerType #4954

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

kastiglione
Copy link

@kastiglione kastiglione commented Jul 7, 2022

For TypeSystemSwiftTypeRef::GetPointerType to succeed, the given type variable first must be demangled. If that fails, the function must return an empty CompilerType.

This fixes downstream crashes in GetPointerTO where Node::addChild is called, but with a null node. This causes an abort in addChild, where the child node is required to be non-null.

rdar://96170947

@kastiglione kastiglione requested a review from augusto2112 July 7, 2022 20:16
@kastiglione
Copy link
Author

@swift-ci test

Copy link

@augusto2112 augusto2112 left a comment

Choose a reason for hiding this comment

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

Thanks!

@kastiglione
Copy link
Author

swiftlang/swift#59955

@swift-ci please test

@kastiglione kastiglione merged commit 21d1b51 into stable/20211026 Jul 8, 2022
@kastiglione kastiglione deleted the lldb-handle-unsupported-type-in-getpointertype branch July 8, 2022 16:25
kastiglione added a commit that referenced this pull request Jul 12, 2022
For `TypeSystemSwiftTypeRef::GetPointerType` to succeed, the given type variable first must be demangled. If that fails, the function must return an empty `CompilerType`.

This fixes downstream crashes [in `GetPointerTO` where `Node::addChild` is called](https://github.com/apple/llvm-project/blob/1d75a24ee862516c100d6a540c566349a79c3522/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp#L269), but with a null node. This causes an [abort in `addChild`](https://github.com/apple/swift/blob/380e370157655a102e6cf1abd46b74d575f2ecce/lib/Demangling/Demangler.cpp#L345), where the child node is required to be non-null.

rdar://96170947

(cherry picked from #4954)
kastiglione added a commit that referenced this pull request Jul 15, 2022
For `TypeSystemSwiftTypeRef::GetPointerType` to succeed, the given type variable first must be demangled. If that fails, the function must return an empty `CompilerType`.

This fixes downstream crashes [in `GetPointerTO` where `Node::addChild` is called](https://github.com/apple/llvm-project/blob/1d75a24ee862516c100d6a540c566349a79c3522/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp#L269), but with a null node. This causes an [abort in `addChild`](https://github.com/apple/swift/blob/380e370157655a102e6cf1abd46b74d575f2ecce/lib/Demangling/Demangler.cpp#L345), where the child node is required to be non-null.

rdar://96170947

(cherry picked from #4954)
kastiglione added a commit that referenced this pull request Jul 15, 2022
kastiglione added a commit that referenced this pull request Jul 15, 2022
For `TypeSystemSwiftTypeRef::GetPointerType` to succeed, the given type variable first must be demangled. If that fails, the function must return an empty `CompilerType`.

This fixes downstream crashes [in `GetPointerTo` where `Node::addChild` is called](https://github.com/apple/llvm-project/blob/1d75a24ee862516c100d6a540c566349a79c3522/lldb/source/Plugins/TypeSystem/Swift/TypeSystemSwiftTypeRef.cpp#L269), but with a null node. This causes an [abort in `addChild`](https://github.com/apple/swift/blob/380e370157655a102e6cf1abd46b74d575f2ecce/lib/Demangling/Demangler.cpp#L345), where the child node is required to be non-null.

rdar://96170947
(cherry-picked from commit 21d1b51)
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