isl_basic_map_normalize_constraints: avoid NULL pointer dereference
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 25 Jun 2010 15:16:56 +0000 (17:16 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 26 Jun 2010 15:37:39 +0000 (17:37 +0200)
isl_map_simplify.c

index 8c2dde0..7326f3a 100644 (file)
@@ -317,6 +317,9 @@ struct isl_basic_map *isl_basic_map_normalize_constraints(
        isl_int gcd;
        unsigned total = isl_basic_map_total_dim(bmap);
 
+       if (!bmap)
+               return NULL;
+
        isl_int_init(gcd);
        for (i = bmap->n_eq - 1; i >= 0; --i) {
                isl_seq_gcd(bmap->eq[i]+1, total, &gcd);