diff options
| author | Sean Callanan <scallanan@apple.com> | 2012-04-25 17:46:01 +0000 |
|---|---|---|
| committer | Sean Callanan <scallanan@apple.com> | 2012-04-25 17:46:01 +0000 |
| commit | e8dea98b5e3f93b32875cfa178537dba2efdf5ae (patch) | |
| tree | da427bb88127021dee10d58643c46db83b793d0c /lldb/source/Expression | |
| parent | 5d2735e502d9123a1213ae64f9c559bc016838e3 (diff) | |
| download | bcm5719-llvm-e8dea98b5e3f93b32875cfa178537dba2efdf5ae.tar.gz bcm5719-llvm-e8dea98b5e3f93b32875cfa178537dba2efdf5ae.zip | |
Hardened LLDB against NULL identifiers being passed
into FindExternalVisibleDeclsByName.
llvm-svn: 155561
Diffstat (limited to 'lldb/source/Expression')
| -rw-r--r-- | lldb/source/Expression/ClangASTSource.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lldb/source/Expression/ClangASTSource.cpp b/lldb/source/Expression/ClangASTSource.cpp index 5461f1918c7..4c31c223b89 100644 --- a/lldb/source/Expression/ClangASTSource.cpp +++ b/lldb/source/Expression/ClangASTSource.cpp @@ -76,8 +76,15 @@ ClangASTSource::FindExternalVisibleDeclsByName 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. |

