Hardened LLDB against NULL identifiers being passed
into FindExternalVisibleDeclsByName.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@155561 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangASTSource.cpp b/source/Expression/ClangASTSource.cpp
index 5461f19..4c31c22 100644
--- a/source/Expression/ClangASTSource.cpp
+++ b/source/Expression/ClangASTSource.cpp
@@ -76,8 +76,15 @@
switch (clang_decl_name.getNameKind()) {
// Normal identifiers.
case DeclarationName::Identifier:
- if (clang_decl_name.getAsIdentifierInfo()->getBuiltinID() != 0)
- return SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ {
+ clang::IdentifierInfo *identifier_info = clang_decl_name.getAsIdentifierInfo();
+
+ if (!identifier_info ||
+ identifier_info->getBuiltinID() != 0)
+ {
+ return SetNoExternalVisibleDeclsForName(decl_ctx, clang_decl_name);
+ }
+ }
break;
// Operator names. Not important for now.