[llvm-commits] CVS: llvm/lib/CodeGen/InstrSched/SchedGraph.cpp

John Criswell criswell at cs.uiuc.edu
Thu Aug 28 16:44:01 PDT 2003


Changes in directory llvm/lib/CodeGen/InstrSched:

SchedGraph.cpp updated: 1.49 -> 1.50

---
Log message:

Fixed two double free bugs that caused llc to segfault or run forever.



---
Diffs of the changes:

Index: llvm/lib/CodeGen/InstrSched/SchedGraph.cpp
diff -u llvm/lib/CodeGen/InstrSched/SchedGraph.cpp:1.49 llvm/lib/CodeGen/InstrSched/SchedGraph.cpp:1.50
--- llvm/lib/CodeGen/InstrSched/SchedGraph.cpp:1.49	Thu Aug 28 10:30:40 2003
+++ llvm/lib/CodeGen/InstrSched/SchedGraph.cpp	Thu Aug 28 16:43:17 2003
@@ -53,10 +53,18 @@
   }
 }
 
+//
+// Method: SchedGraphNode Destructor
+//
+// Description:
+//	Free memory allocated by the SchedGraphNode object.
+//
+// Notes:
+//	Do not delete the edges here.  The base class will take care of that.
+//	Only handle subclass specific stuff here (where currently there is
+//	none).
+//
 SchedGraphNode::~SchedGraphNode() {
-  // for each node, delete its out-edges
-  std::for_each(beginOutEdges(), endOutEdges(),
-                deleter<SchedGraphEdge>);
 }
 
 // 
@@ -67,11 +75,19 @@
   buildGraph(target);
 }
 
+//
+// Method: SchedGraph Destructor
+//
+// Description:
+//	This method deletes memory allocated by the SchedGraph object.
+//
+// Notes:
+//	Do not delete the graphRoot or graphLeaf here.  The base class handles
+//	that bit of work.
+//
 SchedGraph::~SchedGraph() {
   for (const_iterator I = begin(); I != end(); ++I)
     delete I->second;
-  delete graphRoot;
-  delete graphLeaf;
 }
 
 void SchedGraph::dump() const {





More information about the llvm-commits mailing list