isl_basic_map_cow: check result of allocation
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 25 Jun 2010 15:01:33 +0000 (17:01 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 26 Jun 2010 15:37:38 +0000 (17:37 +0200)
isl_map.c

index 07b1e99..186dc77 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -1088,7 +1088,8 @@ struct isl_basic_map *isl_basic_map_cow(struct isl_basic_map *bmap)
                bmap->ref--;
                bmap = isl_basic_map_dup(bmap);
        }
-       ISL_F_CLR(bmap, ISL_BASIC_SET_FINAL);
+       if (bmap)
+               ISL_F_CLR(bmap, ISL_BASIC_SET_FINAL);
        return bmap;
 }