2017-10-13 07:22:41 +03:00
|
|
|
Index: tools/dsymutil/DwarfLinker.cpp
|
|
|
|
===================================================================
|
|
|
|
--- a/llvm/tools/dsymutil/DwarfLinker.cpp (revision 313871)
|
|
|
|
+++ b/llvm/tools/dsymutil/DwarfLinker.cpp (revision 313872)
|
Bug 1410148 - Backport llvm r289565 to clang 3.9. r=gps
I was able to reproduce the failure to apply llvm-dsymutil on the last
mozilla-central revision before debug info was temporarily disabled for
rust, and validated that the problem was gone in clang 4.
After some bisection, r289565 was identified as having fixed the
problem, which, reading the commit message, makes sense.
It was however not possible to simply cherry-pick, because of multiple
code changes between 3.9 and 4. However, apart from the volume of
conflicting changes, it was more or less straightforward to backport.
Interestingly, the patch for r313872 was relying on changes from
r289565, which is why it required a variant specifically for 3.9, but
now we can use the same patch as for other versions. Well, except
there's a small difference in the context, and build-clang.py doesn't
allow fuzz, so we manually edit the patch to remove that line from the
context.
--HG--
extra : rebase_source : de0ab262d401c37c0e9300b0ef7923a07c009d87
2017-12-28 08:54:51 +03:00
|
|
|
@@ -1496,7 +1496,11 @@
|
2017-10-13 07:22:41 +03:00
|
|
|
|
|
|
|
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", &DIE);
|
|
|
|
return DWARFDie();
|