[PATCH] D62118: [DWARF] hoist nullptr checks. NFC

Nick Desaulniers via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 20 09:56:38 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL361176: [DWARF] hoist nullptr checks. NFC (authored by nickdesaulniers, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D62118?vs=200198&id=200320#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D62118

Files:
  llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp


Index: llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp
===================================================================
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFFormValue.cpp
@@ -401,12 +401,14 @@
   case DW_FORM_addrx3:
   case DW_FORM_addrx4:
   case DW_FORM_GNU_addr_index: {
+    if (U == nullptr) {
+      OS << "<invalid dwarf unit>";
+      break;
+    }
     Optional<object::SectionedAddress> A = U->getAddrOffsetSectionItem(UValue);
     if (!A || DumpOpts.Verbose)
       AddrOS << format("indexed (%8.8x) address = ", (uint32_t)UValue);
-    if (U == nullptr)
-      OS << "<invalid dwarf unit>";
-    else if (A)
+    if (A)
       dumpSectionedAddress(AddrOS, DumpOpts, *A);
     else
       OS << "<no .debug_addr section>";


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62118.200320.patch
Type: text/x-patch
Size: 798 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190520/ee311945/attachment.bin>


More information about the llvm-commits mailing list