gecko-dev/build/build-clang/r313872-for-3.9.patch
Mike Hommey e0a1996b7e Bug 1381043 - Backport llvm r313872 to 3.9 to avoid llvm-dsymutil crashing on bad rust DWARF data. r=froydnj
Ideally, we'd backport it to the clang 4 toolchain too, but that results
in silently(!) missing crash symbols for libxul.

--HG--
extra : rebase_source : a3024abf720ea6e9dc0e3271a5aa2ebfae9bebee
2017-10-12 17:54:31 +09:00

18 lines
647 B
Diff

--- a/llvm/tools/dsymutil/DwarfLinker.cpp
+++ b/llvm/tools/dsymutil/DwarfLinker.cpp
@@ -1489,8 +1489,12 @@
uint64_t RefOffset = *RefValue.getAsReference(&Unit);
if ((RefCU = getUnitForOffset(Units, RefOffset)))
- if (const auto *RefDie = RefCU->getOrigUnit().getDIEForOffset(RefOffset))
- return RefDie;
+ if (const auto *RefDie = RefCU->getOrigUnit().getDIEForOffset(RefOffset)) {
+ // In a file with broken references, an attribute might point to a NULL
+ // DIE.
+ if(!RefDie->isNULL())
+ return RefDie;
+ }
Linker.reportWarning("could not find referenced DIE", &Unit, &DIE);
return nullptr;