Skip to content

Commit c026ae4

Browse files
committed
Watch for tombstoned type unit entries and fix error report format string.
1 parent e3325e7 commit c026ae4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,8 @@ unsigned DWARFVerifier::verifyNameIndexEntries(
16451645
UnitOffset = NI.getCUOffset(*CUIndex);
16461646
}
16471647

1648-
if (!UnitOffset)
1648+
// Watch for tombstoned type unit entries.
1649+
if (!UnitOffset || UnitOffset == UINT32_MAX)
16491650
continue;
16501651
// For split DWARF entries we need to make sure we find the non skeleton
16511652
// DWARF unit that is needed and use that's DWARF unit offset as the
@@ -1657,7 +1658,7 @@ unsigned DWARFVerifier::verifyNameIndexEntries(
16571658
ErrorCategory.Report(
16581659
"Name Index entry contains invalid CU or TU offset", [&]() {
16591660
error() << formatv("Name Index @ {0:x}: Entry @ {1:x} contains an "
1660-
"invalid CU or TU offset {1:x}.\n",
1661+
"invalid CU or TU offset {2:x}.\n",
16611662
NI.getUnitOffset(), EntryID, *UnitOffset);
16621663
});
16631664
++NumErrors;

0 commit comments

Comments
 (0)