Hardened LLDB against NULL identifiers being passed

into FindExternalVisibleDeclsByName.

llvm-svn: 155561
This commit is contained in:
Sean Callanan 2012-04-25 17:46:01 +00:00
parent 5d2735e502
commit e8dea98b5e
1 changed files with 9 additions and 2 deletions

View File

@ -76,8 +76,15 @@ ClangASTSource::FindExternalVisibleDeclsByName
switch (clang_decl_name.getNameKind()) { switch (clang_decl_name.getNameKind()) {
// Normal identifiers. // Normal identifiers.
case DeclarationName::Identifier: 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; break;
// Operator names. Not important for now. // Operator names. Not important for now.