diff --git a/llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp b/llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp --- a/llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp @@ -326,6 +326,9 @@ bool IsEH) const { uint32_t EntryValExprSize = 0; uint64_t EntryValStartOffset = 0; + if (Data.getData().empty()){ + OS << ""; + } for (auto &Op : *this) { if (!Op.print(OS, DumpOpts, this, RegInfo, U, IsEH)) { uint64_t FailOffset = Op.getEndOffset(); diff --git a/llvm/test/MC/X86/dwarf-size-field-overflow.test b/llvm/test/MC/X86/dwarf-size-field-overflow.test --- a/llvm/test/MC/X86/dwarf-size-field-overflow.test +++ b/llvm/test/MC/X86/dwarf-size-field-overflow.test @@ -6,7 +6,7 @@ # # CHECK: 0x0000004d: DW_TAG_formal_parameter # CHECK-NEXT: DW_AT_location (0x00000000 -# CHECK-NEXT: [0x0000000000000000, 0x0000000000000008): ) +# CHECK-NEXT: [0x0000000000000000, 0x0000000000000008): ) # CHECK-NEXT: DW_AT_name ("self") import sys