summaryrefslogtreecommitdiffhomepage
path: root/ir/kaps
diff options
context:
space:
mode:
authorSebastian Buchwald <Sebastian.Buchwald@kit.edu>2013-01-22 12:41:04 +0100
committerSebastian Buchwald <Sebastian.Buchwald@kit.edu>2013-01-22 12:41:04 +0100
commitdfa4f0499c3d7f7f3ed023d351171cec3789ee09 (patch)
treed1115a37693762eedd038d8a7ee09b4382290c2c /ir/kaps
parent2267eee857ed89eaa4df2189a39161ba0cf0ea8e (diff)
Bugfix: Check whether edge is deleted before touching its nodes.
Diffstat (limited to 'ir/kaps')
-rw-r--r--ir/kaps/optimal.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ir/kaps/optimal.c b/ir/kaps/optimal.c
index 74f6970..e52bb33 100644
--- a/ir/kaps/optimal.c
+++ b/ir/kaps/optimal.c
@@ -636,6 +636,10 @@ void reorder_node_after_edge_insertion(pbqp_node_t *node)
void simplify_edge(pbqp_t *pbqp, pbqp_edge_t *edge)
{
+ /* If edge are already deleted, we have nothing to do. */
+ if (is_deleted(edge))
+ return;
+
pbqp_matrix_t *mat;
pbqp_node_t *src_node;
pbqp_node_t *tgt_node;
@@ -651,10 +655,6 @@ void simplify_edge(pbqp_t *pbqp, pbqp_edge_t *edge)
assert(src_node);
assert(tgt_node);
- /* If edge are already deleted, we have nothing to do. */
- if (is_deleted(edge))
- return;
-
#if KAPS_DUMP
if (pbqp->dump_file) {
char txt[100];