isl_basic_map_eliminate_vars: avoid invalid access on error
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 2 Dec 2012 14:34:09 +0000 (15:34 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 2 Dec 2012 14:34:09 +0000 (15:34 +0100)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_map_simplify.c

index c3bbbc4..c83888a 100644 (file)
@@ -1449,6 +1449,8 @@ struct isl_basic_map *isl_basic_map_eliminate_vars(
        bmap = isl_basic_map_cow(bmap);
        for (d = pos + n - 1; d >= 0 && d >= pos; --d)
                bmap = remove_dependent_vars(bmap, d);
+       if (!bmap)
+               return NULL;
 
        for (d = pos + n - 1;
             d >= 0 && d >= total - bmap->n_div && d >= pos; --d)