From: Sven Verdoolaege Date: Tue, 7 Dec 2010 09:36:51 +0000 (+0100) Subject: isl_basic_set_lift: properly update the number of extra variables X-Git-Tag: isl-0.05~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c151ce24e5cec7bb995014e3187b9453f8de4761;p=platform%2Fupstream%2Fisl.git isl_basic_set_lift: properly update the number of extra variables Updating this number is essential for maintaining a proper internal state. Reported-by: Tobias Grosser Signed-off-by: Sven Verdoolaege --- diff --git a/isl_map.c b/isl_map.c index 335fad0..6f616cd 100644 --- a/isl_map.c +++ b/isl_map.c @@ -7144,6 +7144,7 @@ __isl_give isl_basic_set *isl_basic_set_lift(__isl_take isl_basic_set *bset) goto error; isl_dim_free(bset->dim); bset->dim = dim; + bset->extra -= bset->n_div; bset->n_div = 0; bset = isl_basic_set_finalize(bset); diff --git a/isl_test.c b/isl_test.c index 8501e84..ab446a2 100644 --- a/isl_test.c +++ b/isl_test.c @@ -1563,6 +1563,20 @@ void test_bound(isl_ctx *ctx) isl_pw_qpolynomial_fold_free(pwf); } +void test_lift(isl_ctx *ctx) +{ + const char *str; + isl_basic_map *bmap; + isl_basic_set *bset; + + str = "{ [i0] : exists e0 : i0 = 4e0 }"; + bset = isl_basic_set_read_from_str(ctx, str, 0); + bset = isl_basic_set_lift(bset); + bmap = isl_basic_map_from_range(bset); + bset = isl_basic_map_domain(bmap); + isl_basic_set_free(bset); +} + int main() { struct isl_ctx *ctx; @@ -1571,6 +1585,7 @@ int main() assert(srcdir); ctx = isl_ctx_alloc(); + test_lift(ctx); test_bound(ctx); test_union(ctx); test_split_periods(ctx);