aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/CompleteBottomUp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis/DataStructure/CompleteBottomUp.cpp')
-rw-r--r--lib/Analysis/DataStructure/CompleteBottomUp.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Analysis/DataStructure/CompleteBottomUp.cpp b/lib/Analysis/DataStructure/CompleteBottomUp.cpp
index ee111e9d8f..3cd2bb0eef 100644
--- a/lib/Analysis/DataStructure/CompleteBottomUp.cpp
+++ b/lib/Analysis/DataStructure/CompleteBottomUp.cpp
@@ -157,6 +157,9 @@ unsigned CompleteBUDataStructures::calculateSCCGraphs(DSGraph &FG,
for (DSGraph::ReturnNodesTy::iterator I = NG->getReturnNodes().begin();
I != NG->getReturnNodes().end(); ++I)
DSInfo[I->first] = &FG;
+
+ // Remove NG from the ValMap since the pointer may get recycled.
+ ValMap.erase(NG);
delete NG;
Stack.pop_back();