[PATCH] D107554: [DWARF][Verifier] Do not add child DieRangeInfo with empty address range to the parent.
Alexey Lapshin via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 6 13:56:53 PDT 2021
avl 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.
----------------
clayborg wrote:
> 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?
no. in this case parent would have a zero length address range ParentRI.Ranges[0]={0,0}. RI.Ranges would be non empty since RI.Ranges[0]={1000,2000}. and then the error would be reported. Will add a test case proves that the error is still reported.
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