[llvm-commits] [lld] r167245 - /lld/trunk/lib/ReaderWriter/MachO/WriterMachO.cpp
Michael J. Spencer
bigcheesegs at gmail.com
Thu Nov 1 12:46:06 PDT 2012
Author: mspencer
Date: Thu Nov 1 14:46:06 2012
New Revision: 167245
URL: http://llvm.org/viewvc/llvm-project?rev=167245&view=rev
Log:
[MachO] Fix use after free.
Modified:
lld/trunk/lib/ReaderWriter/MachO/WriterMachO.cpp
Modified: lld/trunk/lib/ReaderWriter/MachO/WriterMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/WriterMachO.cpp?rev=167245&r1=167244&r2=167245&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/WriterMachO.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/WriterMachO.cpp Thu Nov 1 14:46:06 2012
@@ -206,6 +206,7 @@
dyld_info_command *_dyldInfoLoadCommand;
std::vector<load_command*> _loadCmds;
std::vector<ChunkSegInfo> _sectionInfo;
+ llvm::StringMap<uint32_t> dylibNamesToOrdinal;
};
@@ -774,7 +775,6 @@
this->addLoadCommand(new dylinker_command("/usr/lib/dyld", is64));
// Add dylib load commands.
- llvm::StringMap<uint32_t> dylibNamesToOrdinal;
for (const SharedLibraryAtom* shlibAtom : file.sharedLibrary() ) {
StringRef installName = shlibAtom->loadName();
if ( dylibNamesToOrdinal.count(installName) == 0 ) {
More information about the llvm-commits
mailing list