From: Michael J. Spencer Date: Thu, 1 Nov 2012 19:46:06 +0000 (+0000) Subject: [MachO] Fix use after free. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d91bc3c8bbd314b336efedabb7424d4fe868f800;p=platform%2Fupstream%2Fllvm.git [MachO] Fix use after free. llvm-svn: 167245 --- diff --git a/lld/lib/ReaderWriter/MachO/WriterMachO.cpp b/lld/lib/ReaderWriter/MachO/WriterMachO.cpp index bd2b9bb..3e00b31 100644 --- a/lld/lib/ReaderWriter/MachO/WriterMachO.cpp +++ b/lld/lib/ReaderWriter/MachO/WriterMachO.cpp @@ -206,6 +206,7 @@ private: dyld_info_command *_dyldInfoLoadCommand; std::vector _loadCmds; std::vector _sectionInfo; + llvm::StringMap dylibNamesToOrdinal; }; @@ -774,7 +775,6 @@ void LoadCommandsChunk::computeSize(const lld::File &file) { this->addLoadCommand(new dylinker_command("/usr/lib/dyld", is64)); // Add dylib load commands. - llvm::StringMap dylibNamesToOrdinal; for (const SharedLibraryAtom* shlibAtom : file.sharedLibrary() ) { StringRef installName = shlibAtom->loadName(); if ( dylibNamesToOrdinal.count(installName) == 0 ) {