[DWARF] Replace assert with diagnostic. PR36868.
llvm-svn: 328235
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
index 69a6e7f..dbe1185 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
@@ -551,8 +551,14 @@
// from the size of the operand.
if (DebugLineData.getAddressSize() == 0)
DebugLineData.setAddressSize(Len - 1);
- else
- assert(DebugLineData.getAddressSize() == Len - 1);
+ else if (DebugLineData.getAddressSize() != Len - 1) {
+ fprintf(stderr, "Mismatching address size at offset 0x%8.8" PRIx32
+ " expected 0x%2.2" PRIx32 " found 0x%2.2" PRIx64 "\n",
+ ExtOffset, DebugLineData.getAddressSize(), Len - 1);
+ // Skip the rest of the line-number program.
+ *OffsetPtr = EndOffset;
+ return false;
+ }
State.Row.Address = DebugLineData.getRelocatedAddress(OffsetPtr);
if (OS)
*OS << format(" (0x%16.16" PRIx64 ")", State.Row.Address);