From 89fbd2940acfcde9a18a9574ca0515cc1c4fae70 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 20 Nov 2012 11:19:00 +0100 Subject: [PATCH] isl_tab_sample: treat emptiness of tableau as error We only modify the tableau through calls to isl_tab_add_valid_eq, which should never result in an empty tableau, given that the tableau was initially not empty. Signed-off-by: Sven Verdoolaege --- isl_sample.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/isl_sample.c b/isl_sample.c index 197f0b51..d9cdc003 100644 --- a/isl_sample.c +++ b/isl_sample.c @@ -455,16 +455,16 @@ struct isl_vec *isl_tab_sample(struct isl_tab *tab) reduced = 0; while (level >= 0) { - int empty = 0; if (init) { res = isl_tab_min(tab, tab->basis->row[1 + level], ctx->one, &min->el[level], NULL, 0); - if (res == isl_lp_empty) - empty = 1; - isl_assert(ctx, res != isl_lp_unbounded, goto error); if (res == isl_lp_error) goto error; - if (!empty && isl_tab_sample_is_integer(tab)) + if (res != isl_lp_ok) + isl_die(ctx, isl_error_internal, + "expecting bounded rational solution", + goto error); + if (isl_tab_sample_is_integer(tab)) break; isl_seq_neg(tab->basis->row[1 + level] + 1, tab->basis->row[1 + level] + 1, dim); @@ -473,15 +473,15 @@ struct isl_vec *isl_tab_sample(struct isl_tab *tab) isl_seq_neg(tab->basis->row[1 + level] + 1, tab->basis->row[1 + level] + 1, dim); isl_int_neg(max->el[level], max->el[level]); - if (res == isl_lp_empty) - empty = 1; - isl_assert(ctx, res != isl_lp_unbounded, goto error); if (res == isl_lp_error) goto error; - if (!empty && isl_tab_sample_is_integer(tab)) + if (res != isl_lp_ok) + isl_die(ctx, isl_error_internal, + "expecting bounded rational solution", + goto error); + if (isl_tab_sample_is_integer(tab)) break; - if (!empty && !reduced && - ctx->opt->gbr != ISL_GBR_NEVER && + if (!reduced && ctx->opt->gbr != ISL_GBR_NEVER && isl_int_lt(min->el[level], max->el[level])) { unsigned gbr_only_first; if (ctx->opt->gbr == ISL_GBR_ONCE) @@ -502,7 +502,7 @@ struct isl_vec *isl_tab_sample(struct isl_tab *tab) } else isl_int_add_ui(min->el[level], min->el[level], 1); - if (empty || isl_int_gt(min->el[level], max->el[level])) { + if (isl_int_gt(min->el[level], max->el[level])) { level--; init = 0; if (level >= 0) -- 2.11.4.GIT