diff --git a/lib/Object/COFFObjectFile.cpp b/lib/Object/COFFObjectFile.cpp index f19836b718a..7de51a43f33 100644 --- a/lib/Object/COFFObjectFile.cpp +++ b/lib/Object/COFFObjectFile.cpp @@ -284,6 +284,7 @@ error_code COFFObjectFile::getSymbolSection(DataRefImpl Symb, const coff_section *sec; if (error_code ec = getSection(symb->SectionNumber, sec)) return ec; DataRefImpl Sec; + std::memset(&Sec, 0, sizeof(Sec)); Sec.p = reinterpret_cast(sec); Result = section_iterator(SectionRef(Sec, this)); } @@ -618,6 +619,7 @@ error_code COFFObjectFile::getRelocationSymbol(DataRefImpl Rel, SymbolRef &Res) const { const coff_relocation* R = toRel(Rel); DataRefImpl Symb; + std::memset(&Symb, 0, sizeof(Symb)); Symb.p = reinterpret_cast(SymbolTable + R->SymbolTableIndex); Res = SymbolRef(Symb, this); return object_error::success;