Index: llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp =================================================================== --- llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp +++ llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp @@ -163,7 +163,8 @@ DIType *BaseType = DDTy->getBaseType().resolve(); - assert(BaseType && "Unexpected invalid base type"); + if (!BaseType) + return 0; // If this is a derived type, go ahead and get the base type, unless it's a // reference then it's just the size of the field. Pointer types have no need Index: llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp =================================================================== --- llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -761,7 +761,8 @@ void DwarfUnit::addType(DIE &Entity, const DIType *Ty, dwarf::Attribute Attribute) { - assert(Ty && "Trying to add a type that doesn't exist?"); + if (!Ty) + return; addDIEEntry(Entity, Attribute, DIEEntry(*getOrCreateTypeDIE(Ty))); }