Author: gclayton
Date: Fri May 15 17:31:18 2015
New Revision: 237485

URL: http://llvm.org/viewvc/llvm-project?rev=237485&view=rev
Log:
Don't crash if we have bad debug info that has a DW_TAG_inheritance with a bad 
DW_AT_type reference. Emit an error with instructions to file a bug.

<rdar://problem/20944860>


Modified:
    lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=237485&r1=237484&r2=237485&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Fri May 15 
17:31:18 2015
@@ -2333,8 +2333,15 @@ SymbolFileDWARF::ParseChildMembers
                     }
 
                     Type *base_class_type = ResolveTypeUID(encoding_uid);
-                    assert(base_class_type);
-                    
+                    if (base_class_type == NULL)
+                    {
+                        GetObjectFile()->GetModule()->ReportError("0x%8.8x: 
DW_TAG_inheritance failed to resolve a the base class at 0x%8.8" PRIx64 " from 
enclosing type 0x%8.8x. \nPlease file a bug and attach the file at the start of 
this error message",
+                                                                  
die->GetOffset(),
+                                                                  encoding_uid,
+                                                                  
parent_die->GetOffset());
+                        break;
+                    }
+
                     ClangASTType base_class_clang_type = 
base_class_type->GetClangFullType();
                     assert (base_class_clang_type);
                     if (class_language == eLanguageTypeObjC)


_______________________________________________
lldb-commits mailing list
lldb-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits

Reply via email to