From a482ef2b49ff9bcae7a6898585409181bce3f02a Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Wed, 6 Feb 2013 14:46:21 -0800 Subject: [PATCH] cyclegraph: don't delete promise nodes Merging can fail partway, leaving a somewhat inconsistent graph. This is safe, since an inconsistent graph must be discarded as infeasible. But this is a problem when dumping the modification order graph, since we may dereference freed nodes. So for now, just don't free them. --- cyclegraph.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cyclegraph.cc b/cyclegraph.cc index 69d6660b..e0b22151 100644 --- a/cyclegraph.cc +++ b/cyclegraph.cc @@ -198,7 +198,7 @@ bool CycleGraph::mergeNodes(CycleNode *w_node, CycleNode *p_node, } erasePromiseNode(promise); - delete p_node; + /* Not deleting p_node, to maintain consistency if mergeNodes() fails */ return !hasCycles; } -- 2.34.1