llvm.org GIT mirror llvm / c9afb49
Fixed two double free bugs that caused llc to segfault or run forever. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8191 91177308-0d34-0410-b5e6-96231b3b80d8 John Criswell 17 years ago
2 changed file(s) with 42 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
5252 }
5353 }
5454
55 //
56 // Method: SchedGraphNode Destructor
57 //
58 // Description:
59 // Free memory allocated by the SchedGraphNode object.
60 //
61 // Notes:
62 // Do not delete the edges here. The base class will take care of that.
63 // Only handle subclass specific stuff here (where currently there is
64 // none).
65 //
5566 SchedGraphNode::~SchedGraphNode() {
56 // for each node, delete its out-edges
57 std::for_each(beginOutEdges(), endOutEdges(),
58 deleter);
5967 }
6068
6169 //
6674 buildGraph(target);
6775 }
6876
77 //
78 // Method: SchedGraph Destructor
79 //
80 // Description:
81 // This method deletes memory allocated by the SchedGraph object.
82 //
83 // Notes:
84 // Do not delete the graphRoot or graphLeaf here. The base class handles
85 // that bit of work.
86 //
6987 SchedGraph::~SchedGraph() {
7088 for (const_iterator I = begin(); I != end(); ++I)
7189 delete I->second;
72 delete graphRoot;
73 delete graphLeaf;
7490 }
7591
7692 void SchedGraph::dump() const {
5252 }
5353 }
5454
55 //
56 // Method: SchedGraphNode Destructor
57 //
58 // Description:
59 // Free memory allocated by the SchedGraphNode object.
60 //
61 // Notes:
62 // Do not delete the edges here. The base class will take care of that.
63 // Only handle subclass specific stuff here (where currently there is
64 // none).
65 //
5566 SchedGraphNode::~SchedGraphNode() {
56 // for each node, delete its out-edges
57 std::for_each(beginOutEdges(), endOutEdges(),
58 deleter);
5967 }
6068
6169 //
6674 buildGraph(target);
6775 }
6876
77 //
78 // Method: SchedGraph Destructor
79 //
80 // Description:
81 // This method deletes memory allocated by the SchedGraph object.
82 //
83 // Notes:
84 // Do not delete the graphRoot or graphLeaf here. The base class handles
85 // that bit of work.
86 //
6987 SchedGraph::~SchedGraph() {
7088 for (const_iterator I = begin(); I != end(); ++I)
7189 delete I->second;
72 delete graphRoot;
73 delete graphLeaf;
7490 }
7591
7692 void SchedGraph::dump() const {