isl_basic_map_foreach_constraint: make sure input has been finalized
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 4 Jun 2010 17:08:34 +0000 (19:08 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 4 Jun 2010 17:08:34 +0000 (19:08 +0200)
Each constraint gets a copy of the input and a line from the constraint
matrix of the input.  If the input wouldn't be finalized, then the copy
would create a duplicate and then the line wouldn't match the basic map.
This is problematic for especially isl_constraint_is_equality.

isl_constraint.c

index 1566a88..d2bdb28 100644 (file)
@@ -203,6 +203,9 @@ int isl_basic_map_foreach_constraint(__isl_keep isl_basic_map *bmap,
        if (!bmap)
                return -1;
 
+       isl_assert(bmap->ctx, ISL_F_ISSET(bmap, ISL_BASIC_MAP_FINAL),
+                       return -1);
+
        for (i = 0; i < bmap->n_eq; ++i) {
                c = isl_basic_map_constraint(isl_basic_map_copy(bmap),
                                                &bmap->eq[i]);