isl_basic_map_normalize: avoid invalid access on error
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 2 Dec 2012 12:14:19 +0000 (13:14 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 2 Dec 2012 12:14:19 +0000 (13:14 +0100)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_map.c

index e168167..6e87e8d 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -8240,7 +8240,8 @@ struct isl_basic_map *isl_basic_map_normalize(struct isl_basic_map *bmap)
                return bmap;
        bmap = isl_basic_map_remove_redundancies(bmap);
        bmap = isl_basic_map_sort_constraints(bmap);
-       ISL_F_SET(bmap, ISL_BASIC_MAP_NORMALIZED);
+       if (bmap)
+               ISL_F_SET(bmap, ISL_BASIC_MAP_NORMALIZED);
        return bmap;
 }