[llvm] beb6972 - fix llvm-gsymutil verification (#141751)
via llvm-commits
llvm-commits at lists.llvm.org
Thu May 29 14:02:31 PDT 2025
Author: peremyach
Date: 2025-05-29T14:02:22-07:00
New Revision: beb6972cbb549eb4f00345f6e04427e266b2dd0c
URL: https://github.com/llvm/llvm-project/commit/beb6972cbb549eb4f00345f6e04427e266b2dd0c
DIFF: https://github.com/llvm/llvm-project/commit/beb6972cbb549eb4f00345f6e04427e266b2dd0c.diff
LOG: 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 at fb.com>
Added:
Modified:
llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
Removed:
################################################################################
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
index a397cad0051db..43e82aee0784a 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
@@ -660,6 +660,11 @@ void DWARFUnit::clearDIEs(bool KeepCUDie, bool KeepDWODies) {
if (!KeepDWODies && DWO) {
DWO->clearDIEs(KeepCUDie, KeepDWODies);
}
+ if (!IsDWO) {
+ RangeSectionBase = 0;
+ LocSectionBase = 0;
+ AddrOffsetSectionBase = std::nullopt;
+ }
// Do not use resize() + shrink_to_fit() to free memory occupied by dies.
// shrink_to_fit() is a *non-binding* request to reduce capacity() to
// size(). It depends on the implementation whether the request is
More information about the llvm-commits
mailing list