Skip to content

Commit beb6972

Browse files
peremyachArslan Khabutdinov
and
Arslan Khabutdinov
authored
fix llvm-gsymutil verification (#141751)
Verification crashed here https://github.com/llvm/llvm-project/blob/main/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp#L519 The reason being that during verification to extract inline_info we recreate compile unit dies. Assert fails because we previously cleaned up just the DIEs but some other fields remained initialized. Co-authored-by: Arslan Khabutdinov <akhabutdinov@fb.com>
1 parent c7cbaef commit beb6972

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,11 @@ void DWARFUnit::clearDIEs(bool KeepCUDie, bool KeepDWODies) {
660660
if (!KeepDWODies && DWO) {
661661
DWO->clearDIEs(KeepCUDie, KeepDWODies);
662662
}
663+
if (!IsDWO) {
664+
RangeSectionBase = 0;
665+
LocSectionBase = 0;
666+
AddrOffsetSectionBase = std::nullopt;
667+
}
663668
// Do not use resize() + shrink_to_fit() to free memory occupied by dies.
664669
// shrink_to_fit() is a *non-binding* request to reduce capacity() to
665670
// size(). It depends on the implementation whether the request is

0 commit comments

Comments
 (0)