[Lldb-commits] [lldb] r155561 - /lldb/trunk/source/Expression/ClangASTSource.cpp
Sean Callanan
scallanan at apple.com
Wed Apr 25 10:46:01 PDT 2012
Author: spyffe
Date: Wed Apr 25 12:46:01 2012
New Revision: 155561
URL: http://llvm.org/viewvc/llvm-project?rev=155561&view=rev
Log:
Hardened LLDB against NULL identifiers being passed
into FindExternalVisibleDeclsByName.
Modified:
lldb/trunk/source/Expression/ClangASTSource.cpp
Modified: lldb/trunk/source/Expression/ClangASTSource.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangASTSource.cpp?rev=155561&r1=155560&r2=155561&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangASTSource.cpp (original)
+++ lldb/trunk/source/Expression/ClangASTSource.cpp Wed Apr 25 12:46:01 2012
@@ -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.
More information about the lldb-commits
mailing list