[lld] r244834 - Fix an use of uninitialized.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 16:25:42 PDT 2015


Author: rafael
Date: Wed Aug 12 18:25:42 2015
New Revision: 244834

URL: http://llvm.org/viewvc/llvm-project?rev=244834&view=rev
Log:
Fix an use of uninitialized.

Should fix some tests on windows.

Modified:
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=244834&r1=244833&r2=244834&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Wed Aug 12 18:25:42 2015
@@ -37,7 +37,9 @@ public:
   typedef typename llvm::object::ELFFile<ELFT>::uintX_t uintX_t;
   typedef typename llvm::object::ELFFile<ELFT>::Elf_Shdr Elf_Shdr;
 
-  OutputSection(StringRef Name) : Name(Name), Header({}) {}
+  OutputSection(StringRef Name) : Name(Name) {
+    memset(&Header, 0, sizeof(Elf_Shdr));
+  }
   void setVA(uintX_t);
   void setFileOffset(uintX_t);
   void addSectionChunk(SectionChunk<ELFT> *C);




More information about the llvm-commits mailing list