1Index: tools/dsymutil/DwarfLinker.cpp 2=================================================================== 3--- a/llvm/tools/dsymutil/DwarfLinker.cpp (revision 313871) 4+++ b/llvm/tools/dsymutil/DwarfLinker.cpp (revision 313872) 5@@ -1496,7 +1496,11 @@ 6 7 if ((RefCU = getUnitForOffset(Units, RefOffset))) 8- if (const auto RefDie = RefCU->getOrigUnit().getDIEForOffset(RefOffset)) 9- return RefDie; 10+ if (const auto RefDie = RefCU->getOrigUnit().getDIEForOffset(RefOffset)) { 11+ // In a file with broken references, an attribute might point to a NULL 12+ // DIE. 13+ if(!RefDie.isNULL()) 14+ return RefDie; 15+ } 16 17 Linker.reportWarning("could not find referenced DIE", &DIE); 18 return DWARFDie(); 19