From: Sven Verdoolaege Date: Tue, 14 Feb 2012 23:18:59 +0000 (+0100) Subject: isl_map_fix_si: drop basic maps that have become empty X-Git-Tag: isl-0.10~121 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=089560ea6e901100ec4505b2b9341af84a0b0728;p=platform%2Fupstream%2Fisl.git isl_map_fix_si: drop basic maps that have become empty Signed-off-by: Sven Verdoolaege --- diff --git a/isl_map.c b/isl_map.c index 4cbecc3..6339d46 100644 --- a/isl_map.c +++ b/isl_map.c @@ -4957,9 +4957,9 @@ struct isl_map *isl_map_fix_si(struct isl_map *map, return NULL; isl_assert(map->ctx, pos < isl_map_dim(map, type), goto error); - for (i = 0; i < map->n; ++i) { + for (i = map->n - 1; i >= 0; --i) { map->p[i] = isl_basic_map_fix_si(map->p[i], type, pos, value); - if (!map->p[i]) + if (remove_if_empty(map, i) < 0) goto error; } ISL_F_CLR(map, ISL_MAP_NORMALIZED);