Skip to content

[lldb][TypeSystemClang] Avoid accessing definition if none is available #9227

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
merged 1 commit into from
Sep 9, 2024

Conversation

Michael137
Copy link

We've been hitting cases where LLDB marks a decl as isCompleteDefinition but no definition was allocated for it. Then when we access a an API in which Clang assumes a definition exists, and dereferences a nullptr. In the specific case that happens when we've incorrectly been keeping track of the ImportedDecls in clang::ASTImporter (which manifests as trying to MapImported on two different destination decls from the same source decl for the same ClangASTImporterDelegate).

The more fundmental issue is that we're failing to complete the type properly. But the fix for that is still in-progress. So we're working around the crash by guarding against failed type completion.

rdar://133958782

We've been hitting cases where LLDB marks a decl as
`isCompleteDefinition` but no definition was allocated
for it. Then when we access a an API in which Clang
assumes a definition exists, and dereferences a nullptr.
In the specific case that happens when we've incorrectly
been keeping track of the `ImportedDecls` in `clang::ASTImporter`
(which manifests as trying to `MapImported` on two different
destination decls from the same source decl for the same
ClangASTImporterDelegate).

The more fundmental issue is that we're failing to complete
the type properly. But the fix for that is still in-progress.
So we're working around the crash by guarding against failed
type completion.

rdar://133958782
@Michael137
Copy link
Author

@swift-ci test

@adrian-prantl adrian-prantl merged commit 5171d80 into swift/release/6.0 Sep 9, 2024
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