diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2013-05-15 12:03:33 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2013-05-15 12:03:33 +0200 |
commit | 9ce4b8d3551fedd10a8a0d3b27f377f922dcd3b8 (patch) | |
tree | ed1a42e37365dbbd5937e93952871bf06bf29a50 /ufo/ufo-graph.c | |
parent | 56b8a477508ed223fe22205611f7dfe31591ee84 (diff) |
Fix #189: don't copy nodes with more than one input
Diffstat (limited to 'ufo/ufo-graph.c')
-rw-r--r-- | ufo/ufo-graph.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/ufo/ufo-graph.c b/ufo/ufo-graph.c index fe38f4d..ce07cd9 100644 --- a/ufo/ufo-graph.c +++ b/ufo/ufo-graph.c @@ -589,11 +589,22 @@ ufo_graph_expand (UfoGraph *graph, next = UFO_NODE (it->data); + /* + * Do not copy node if it has more than one input because input data + * cannot be reliably associated + */ + if (ufo_graph_get_num_predecessors (graph, next) <= 1) { + copy = ufo_node_copy (next, &error); + label = ufo_graph_get_edge_label (graph, orig, next); + ufo_graph_connect_nodes (graph, current, copy, label); + current = copy; + } + else { + label = ufo_graph_get_edge_label (graph, orig, next); + ufo_graph_connect_nodes (graph, current, next, label); + current = next; + } - copy = ufo_node_copy (next, &error); - label = ufo_graph_get_edge_label (graph, orig, next); - ufo_graph_connect_nodes (graph, current, copy, label); - current = copy; orig = next; } |