Fix a nasty dangling pointer problem, due to a free'd pointer being left in

a map.  This caused problems if a later object happened to be allocated at
the free'd object's address.

llvm-svn: 16813
This commit is contained in:
Chris Lattner 2004-10-07 20:01:31 +00:00
parent 36e1648743
commit d15e144241

View File

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