forked from OSchip/llvm-project
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:
parent
b0b1cb2182
commit
3ae7bb6b7c
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue