Author: resistor Date: Tue Jan 29 19:24:05 2008 New Revision: 46541 URL: http://llvm.org/viewvc/llvm-project?rev=46541&view=rev Log: Fix an issue where, under very specific circumstances, memdep could end up dereferencing the end of one of its internal maps.
Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Modified: llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp?rev=46541&r1=46540&r2=46541&view=diff ============================================================================== --- llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp (original) +++ llvm/trunk/lib/Analysis/MemoryDependenceAnalysis.cpp Tue Jan 29 19:24:05 2008 @@ -451,8 +451,6 @@ // Figure out the new dep for things that currently depend on rem Instruction* newDep = NonLocal; - reverseDep[depGraphLocal[rem].first].erase(rem); - for (DenseMap<BasicBlock*, Value*>::iterator DI = depGraphNonLocal[rem].begin(), DE = depGraphNonLocal[rem].end(); DI != DE; ++DI) @@ -462,6 +460,8 @@ depMapType::iterator depGraphEntry = depGraphLocal.find(rem); if (depGraphEntry != depGraphLocal.end()) { + reverseDep[depGraphLocal[rem].first].erase(rem); + if (depGraphEntry->second.first != NonLocal && depGraphEntry->second.second) { // If we have dep info for rem, set them to it _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits