Skip to content

[lldb] Handle unsupported type in GetPointerType #4962

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 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, but with a null node. This causes an abort in addChild, where the child node is required to be non-null.

rdar://96170947

(cherry picked from #4954)

@kastiglione
Copy link
Author

@swift-ci test

@kastiglione kastiglione merged commit f4f219e into stable/20220421 Jul 12, 2022
@kastiglione kastiglione deleted the lldb-Handle-unsupported-type-in-GetPointerType branch July 12, 2022 20:14
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)
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.

1 participant