isl_basic_map_move_dims: avoid invalid access on error
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 7 Dec 2012 10:42:09 +0000 (7 11:42 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 7 Dec 2012 10:42:09 +0000 (7 11:42 +0100)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_map.c

index b383cfe..51a8600 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -3220,6 +3220,8 @@ __isl_give isl_basic_map *isl_basic_map_move_dims(
        res = isl_basic_map_alloc_space(isl_basic_map_get_space(bmap),
                        bmap->n_div, bmap->n_eq, bmap->n_ineq);
        bmap = isl_basic_map_add_constraints_dim_map(res, bmap, dim_map);
+       if (!bmap)
+               goto error;
 
        bmap->dim = isl_space_move_dims(bmap->dim, dst_type, dst_pos,
                                        src_type, src_pos, n);