diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2012-01-23 05:07:16 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2012-01-23 05:07:16 +0000 |
commit | 4254df306268edb7f47a77eecd1f8b59f1b17fe0 (patch) | |
tree | 33f937c00eee1b844fe63560db3e8f23d7ba84e1 /lib/Archive | |
parent | 603d6b56a2b72358e7b599aab743beb44823d76c (diff) | |
download | external_llvm-4254df306268edb7f47a77eecd1f8b59f1b17fe0.zip external_llvm-4254df306268edb7f47a77eecd1f8b59f1b17fe0.tar.gz external_llvm-4254df306268edb7f47a77eecd1f8b59f1b17fe0.tar.bz2 |
Avoid using an invalidated iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148681 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Archive')
-rw-r--r-- | lib/Archive/ArchiveReader.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Archive/ArchiveReader.cpp b/lib/Archive/ArchiveReader.cpp index 0c89baa..a78c0f5 100644 --- a/lib/Archive/ArchiveReader.cpp +++ b/lib/Archive/ArchiveReader.cpp @@ -572,7 +572,11 @@ Archive::findModulesDefiningSymbols(std::set<std::string>& symbols, SmallPtrSet<Module*, 16> Added; for (std::set<std::string>::iterator I=symbols.begin(), - E=symbols.end(); I != E; ++I) { + Next = I, + E=symbols.end(); I != E; I = Next) { + // Increment Next before we invalidate it. + ++Next; + // See if this symbol exists Module* m = findModuleDefiningSymbol(*I,error); if (!m) |