[llvm-commits] [llvm] r145292 - /llvm/trunk/lib/Object/COFFObjectFile.cpp

Daniel Dunbar daniel at zuster.org
Mon Nov 28 14:19:32 PST 2011


Author: ddunbar
Date: Mon Nov 28 16:19:32 2011
New Revision: 145292

URL: http://llvm.org/viewvc/llvm-project?rev=145292&view=rev
Log:
Fix some possible gcc-4.2 may be used uninitialized warnings.

Modified:
    llvm/trunk/lib/Object/COFFObjectFile.cpp

Modified: llvm/trunk/lib/Object/COFFObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFObjectFile.cpp?rev=145292&r1=145291&r2=145292&view=diff
==============================================================================
--- llvm/trunk/lib/Object/COFFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/COFFObjectFile.cpp Mon Nov 28 16:19:32 2011
@@ -283,7 +283,7 @@
   if (symb->SectionNumber <= COFF::IMAGE_SYM_UNDEFINED)
     Result = end_sections();
   else {
-    const coff_section *sec;
+    const coff_section *sec = 0;
     if (error_code ec = getSection(symb->SectionNumber, sec)) return ec;
     DataRefImpl Sec;
     std::memset(&Sec, 0, sizeof(Sec));
@@ -389,7 +389,7 @@
                                                  bool &Result) const {
   const coff_section *sec = toSec(Sec);
   const coff_symbol *symb = toSymb(Symb);
-  const coff_section *symb_sec;
+  const coff_section *symb_sec = 0;
   if (error_code ec = getSection(symb->SectionNumber, symb_sec)) return ec;
   if (symb_sec == sec)
     Result = true;





More information about the llvm-commits mailing list