[Lldb-commits] [lldb] r179130 - Hardening so we won't crash if an Objective-C interface

Sean Callanan scallanan at apple.com
Tue Apr 9 14:30:48 PDT 2013


Author: spyffe
Date: Tue Apr  9 16:30:48 2013
New Revision: 179130

URL: http://llvm.org/viewvc/llvm-project?rev=179130&view=rev
Log:
Hardening so we won't crash if an Objective-C interface
doesn't have a corresponding type.

<rdar://problem/13596142>

Modified:
    lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp

Modified: lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp?rev=179130&r1=179129&r2=179130&view=diff
==============================================================================
--- lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp (original)
+++ lldb/trunk/source/Expression/ClangExpressionDeclMap.cpp Tue Apr  9 16:30:48 2013
@@ -2893,6 +2893,9 @@ ClangExpressionDeclMap::FindExternalVisi
                     return;
                 
                 const clang::Type *interface_type = self_interface->getTypeForDecl();
+                
+                if (!interface_type)
+                    return; // This is unlikely, but we have seen crashes where this occurred
                         
                 TypeFromUser class_user_type(QualType(interface_type, 0).getAsOpaquePtr(),
                                              &method_decl->getASTContext());





More information about the lldb-commits mailing list