[PATCH] D107554: [DWARF][Verifier] Do not add child DieRangeInfo with empty address range to the parent.

Greg Clayton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 6 12:18:51 PDT 2021


clayborg added inline comments.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp:437
 
-  // Verify that children don't intersect.
-  const auto IntersectingChild = ParentRI.insert(RI);
-  if (IntersectingChild != ParentRI.Children.end()) {
-    ++NumErrors;
-    error() << "DIEs have overlapping address ranges:";
-    dump(Die);
-    dump(IntersectingChild->Die) << '\n';
+  if (!RI.Ranges.empty()) {
+    // Verify that children don't intersect.
----------------
This line will actually stop errors from being emitted where they wouldn't before. If you can make a DW_TAG_subprogram like this:

```
DW_TAG_subprogram
DW_AT_name	("main")
DW_AT_low_pc(0x0)
DW_AT_high_pc(0x0) << Encode with a DW_FORM_addr whose value is the same as the low PC

  DW_TAG_lexical_block
  DW_AT_low_pc(0x1000)
  DW_AT_high_pc(0x2000)
```
This would have been reported before, but wouldn't now because there are no valid ranges in the parent right?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107554/new/

https://reviews.llvm.org/D107554



More information about the llvm-commits mailing list