From 59a8733ad8aa261e7815686324f27fc12d3dd1fa Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sat, 6 Jun 2009 11:12:57 +0200 Subject: [PATCH] isl_map.c: order_divs: swap with correct div The bug in the original code could result in a div being swapped with itself, in turn resulting in an infinite loop. --- isl_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isl_map.c b/isl_map.c index 818d462..7ee8767 100644 --- a/isl_map.c +++ b/isl_map.c @@ -3581,7 +3581,7 @@ static struct isl_basic_map *order_divs(struct isl_basic_map *bmap) bmap->n_div-i); if (pos == -1) continue; - swap_div(bmap, i, pos); + swap_div(bmap, i, i + pos); --i; } return bmap; -- 2.7.4