From 0056e1b9889ce9cdf3669e5ebc02638e5acc448e Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Tue, 15 Nov 2011 21:39:52 +0100 Subject: [PATCH] nv50/ir: Allow attaching two nodes when either one is already inside the graph. --- src/gallium/drivers/nv50/codegen/nv50_ir_graph.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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(); -- 2.30.2