[PATCH] D149121: [DWARF][MC] improve the error message when DwarfLineStrSection is null.

Esme Yi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 7 21:56:55 PDT 2023


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG52ae3b572544: [DWARF][MC] improve the error message when DwarfLineStrSection is null. (authored by Esme).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149121/new/

https://reviews.llvm.org/D149121

Files:
  llvm/lib/MC/MCDwarf.cpp


Index: llvm/lib/MC/MCDwarf.cpp
===================================================================
--- llvm/lib/MC/MCDwarf.cpp
+++ llvm/lib/MC/MCDwarf.cpp
@@ -78,9 +78,12 @@
 
 MCDwarfLineStr::MCDwarfLineStr(MCContext &Ctx) {
   UseRelocs = Ctx.getAsmInfo()->doesDwarfUseRelocationsAcrossSections();
-  if (UseRelocs)
-    LineStrLabel =
-        Ctx.getObjectFileInfo()->getDwarfLineStrSection()->getBeginSymbol();
+  if (UseRelocs) {
+    MCSection *DwarfLineStrSection =
+        Ctx.getObjectFileInfo()->getDwarfLineStrSection();
+    assert(DwarfLineStrSection && "DwarfLineStrSection must not be NULL");
+    LineStrLabel = DwarfLineStrSection->getBeginSymbol();
+  }
 }
 
 //


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149121.520249.patch
Type: text/x-patch
Size: 683 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230508/29838080/attachment.bin>


More information about the llvm-commits mailing list