[llvm] r232833 - DebugInfoFinder: Check for null imported entities
    Duncan P. N. Exon Smith 
    dexonsmith at apple.com
       
    Fri Mar 20 12:13:53 PDT 2015
    
    
  
Author: dexonsmith
Date: Fri Mar 20 14:13:53 2015
New Revision: 232833
URL: http://llvm.org/viewvc/llvm-project?rev=232833&view=rev
Log:
DebugInfoFinder: Check for null imported entities
Don't use the accessors in `DIImportedEntity` on a null pointer.  (A WIP
patch to make `DIDescriptor` accessors more strict crashes here
otherwise.)
Modified:
    llvm/trunk/lib/IR/DebugInfo.cpp
Modified: llvm/trunk/lib/IR/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/DebugInfo.cpp?rev=232833&r1=232832&r2=232833&view=diff
==============================================================================
--- llvm/trunk/lib/IR/DebugInfo.cpp (original)
+++ llvm/trunk/lib/IR/DebugInfo.cpp Fri Mar 20 14:13:53 2015
@@ -674,6 +674,8 @@ void DebugInfoFinder::processModule(cons
       DIArray Imports = CU.getImportedEntities();
       for (unsigned i = 0, e = Imports.getNumElements(); i != e; ++i) {
         DIImportedEntity Import = DIImportedEntity(Imports.getElement(i));
+        if (!Import)
+          continue;
         DIDescriptor Entity = Import.getEntity().resolve(TypeIdentifierMap);
         if (Entity.isType())
           processType(DIType(Entity));
    
    
More information about the llvm-commits
mailing list