continue;
// Verify prologue.
- uint32_t MaxFileIndex = LineTable->Prologue.FileNames.size();
uint32_t MaxDirIndex = LineTable->Prologue.IncludeDirectories.size();
uint32_t FileIndex = 1;
StringMap<uint16_t> FullPathMap;
}
// Verify file index.
- if (Row.File > MaxFileIndex) {
+ if (!LineTable->hasFileAtIndex(Row.File)) {
++NumDebugLineErrors;
+ bool isDWARF5 = LineTable->Prologue.getVersion() >= 5;
error() << ".debug_line["
<< format("0x%08" PRIx64,
*toSectionOffset(Die.find(DW_AT_stmt_list)))
<< "][" << RowIndex << "] has invalid file index " << Row.File
- << " (valid values are [1," << MaxFileIndex << "]):\n";
+ << " (valid values are [" << (isDWARF5 ? "0," : "1,")
+ << LineTable->Prologue.FileNames.size()
+ << (isDWARF5 ? ")" : "]") << "):\n";
DWARFDebugLine::Row::dumpTableHeader(OS);
Row.dump(OS);
OS << '\n';