From: Francisco Jerez Date: Tue, 15 Nov 2011 20:39:52 +0000 (+0100) Subject: nv50/ir: Allow attaching two nodes when either one is already inside the graph. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0056e1b9889ce9cdf3669e5ebc02638e5acc448e;p=mesa.git nv50/ir: Allow attaching two nodes when either one is already inside the graph. --- diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_graph.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_graph.cpp index b1287001c37..069dc485b6a 100644 --- a/src/gallium/drivers/nv50/codegen/nv50_ir_graph.cpp +++ b/src/gallium/drivers/nv50/codegen/nv50_ir_graph.cpp @@ -116,11 +116,11 @@ void Graph::Node::attach(Node *node, Edge::Type kind) ++this->outCount; ++node->inCount; - assert(this->graph); - if (!node->graph) { - node->graph = this->graph; - ++node->graph->size; - } + assert(graph || node->graph); + if (!node->graph) + graph->insert(node); + if (!graph) + node->graph->insert(this); if (kind == Edge::UNKNOWN) graph->classifyEdges();