[lld] r245677 - COFF: Improve debug helper function.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 00:01:11 PDT 2015


Author: ruiu
Date: Fri Aug 21 02:01:10 2015
New Revision: 245677

URL: http://llvm.org/viewvc/llvm-project?rev=245677&view=rev
Log:
COFF: Improve debug helper function.

SectionChunk::getDebugName crashed if the symbol was a nullptr.

Modified:
    lld/trunk/COFF/Chunks.cpp

Modified: lld/trunk/COFF/Chunks.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/Chunks.cpp?rev=245677&r1=245676&r2=245677&view=diff
==============================================================================
--- lld/trunk/COFF/Chunks.cpp (original)
+++ lld/trunk/COFF/Chunks.cpp Fri Aug 21 02:01:10 2015
@@ -217,7 +217,9 @@ void SectionChunk::printDiscardedMessage
 }
 
 StringRef SectionChunk::getDebugName() {
-  return Sym->getName();
+  if (Sym)
+    return Sym->getName();
+  return "";
 }
 
 ArrayRef<uint8_t> SectionChunk::getContents() const {




More information about the llvm-commits mailing list