File tree 2 files changed +11
-4
lines changed
2 files changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -349,13 +349,20 @@ Error DWARFUnitHeader::applyIndexEntry(const DWARFUnitIndex::Entry *Entry) {
349
349
Offset);
350
350
351
351
auto *UnitContrib = IndexEntry->getContribution ();
352
- if (!UnitContrib ||
353
- UnitContrib->getLength () != (getLength () + getUnitLengthFieldByteSize ()))
352
+ if (!UnitContrib)
354
353
return createStringError (errc::invalid_argument,
355
354
" DWARF package unit at offset 0x%8.8" PRIx64
356
- " has an inconsistent index" ,
355
+ " has no contribution index" ,
357
356
Offset);
358
357
358
+ uint64_t IndexLength = getLength () + getUnitLengthFieldByteSize ();
359
+ if (UnitContrib->getLength () != IndexLength)
360
+ return createStringError (errc::invalid_argument,
361
+ " DWARF package unit at offset 0x%8.8" PRIx64
362
+ " has an inconsistent index (expected: %" PRIu64
363
+ " , actual: %" PRIu64 " )" ,
364
+ Offset, UnitContrib->getLength (), IndexLength);
365
+
359
366
auto *AbbrEntry = IndexEntry->getContribution (DW_SECT_ABBREV);
360
367
if (!AbbrEntry)
361
368
return createStringError (errc::invalid_argument,
Original file line number Diff line number Diff line change 4
4
## llvm-dwarfdump used to crash with this input because of an invalid size
5
5
## of the compilation unit contribution in the .debug_cu_index section.
6
6
7
- # CHECK: warning: DWARF package unit at offset 0x00000000 has an inconsistent index
7
+ # CHECK: warning: DWARF package unit at offset 0x00000000 has an inconsistent index (expected: 23, actual: 24)
8
8
9
9
.section .debug_abbrev.dwo, "e" , @progbits
10
10
.LAbbrBegin:
You can’t perform that action at this time.
0 commit comments