diff options
author | Owen Anderson <resistor@mac.com> | 2008-01-30 01:24:05 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-01-30 01:24:05 +0000 |
commit | 25296a217abc67d41197cde0bd5ac72644ea3473 (patch) | |
tree | 0a75fd0e04505668362d3c100045a8300c30c3e1 /lib/Analysis | |
parent | b1534530c2be08779acc66382cee467b01e9097d (diff) | |
download | external_llvm-25296a217abc67d41197cde0bd5ac72644ea3473.zip external_llvm-25296a217abc67d41197cde0bd5ac72644ea3473.tar.gz external_llvm-25296a217abc67d41197cde0bd5ac72644ea3473.tar.bz2 |
Fix an issue where, under very specific circumstances, memdep could end up dereferencing the end
of one of its internal maps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46541 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r-- | lib/Analysis/MemoryDependenceAnalysis.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp index eea0615..445e16d 100644 --- a/lib/Analysis/MemoryDependenceAnalysis.cpp +++ b/lib/Analysis/MemoryDependenceAnalysis.cpp @@ -451,8 +451,6 @@ void MemoryDependenceAnalysis::removeInstruction(Instruction* rem) { // 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 @@ void MemoryDependenceAnalysis::removeInstruction(Instruction* rem) { 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 |