Fix some possible gcc-4.2 may be used uninitialized warnings.
authorDaniel Dunbar <daniel@zuster.org>
Mon, 28 Nov 2011 22:19:32 +0000 (22:19 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 28 Nov 2011 22:19:32 +0000 (22:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145292 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Object/COFFObjectFile.cpp

index c6ce56221a555ee0e2fecb20915989fdc94adc49..5f2a11ed20cc324d5b69a286362132491836c7fc 100644 (file)
@@ -283,7 +283,7 @@ error_code COFFObjectFile::getSymbolSection(DataRefImpl Symb,
   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 @@ error_code COFFObjectFile::sectionContainsSymbol(DataRefImpl Sec,
                                                  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;