mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 17:25:36 +00:00
9f6417f045
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
19 lines
725 B
Diff
19 lines
725 B
Diff
Index: tools/dsymutil/DwarfLinker.cpp
|
|
===================================================================
|
|
--- a/llvm/tools/dsymutil/DwarfLinker.cpp (revision 313871)
|
|
+++ b/llvm/tools/dsymutil/DwarfLinker.cpp (revision 313872)
|
|
@@ -1496,7 +1496,11 @@
|
|
|
|
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();
|