1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 11:13:28 +01:00

Avoid using an invalidated iterator.

llvm-svn: 148681
This commit is contained in:
Rafael Espindola 2012-01-23 05:07:16 +00:00
parent c53beeb5f6
commit 02f4d661a1

View File

@ -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)