isl_basic_map_gist: don't drop equalities from context
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 19 Dec 2009 10:20:34 +0000 (11:20 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 19 Dec 2009 10:53:43 +0000 (11:53 +0100)
The context isn't cowed, so this dropping of equalities would
be visible to the caller.  Instead, drop the equalities after
duplicating the context.

isl_map_simplify.c

index 8623e38..04d2771 100644 (file)
@@ -1576,9 +1576,10 @@ static struct isl_basic_set *uset_gist(struct isl_basic_set *bset,
        bset = remove_shifted_constraints(bset, context);
        if (!bset->n_ineq)
                goto done;
-       isl_basic_set_free_equality(context, context->n_eq);
        context_ineq = context->n_ineq;
        combined = isl_basic_set_cow(isl_basic_set_copy(context));
+       if (isl_basic_set_free_equality(combined, context->n_eq) < 0)
+               goto error;
        combined = isl_basic_set_extend_constraints(combined,
                                                    bset->n_eq, bset->n_ineq);
        tab = isl_tab_from_basic_set(combined);