summaryrefslogtreecommitdiff
path: root/isl_tab_pip.c
diff options
context:
space:
mode:
authorSven Verdoolaege <skimo@kotnet.org>2010-04-10 15:44:03 +0200
committerSven Verdoolaege <skimo@kotnet.org>2010-04-10 16:20:51 +0200
commite18f50ef6f40c2325dcf07da8fc2f960e6f0f9b9 (patch)
treedc4984992783ceb6ae901dce1e90e987954a3de4 /isl_tab_pip.c
parentcb730f62c0b138bf53f695d0630272edb4b1c88e (diff)
downloadisl-e18f50ef6f40c2325dcf07da8fc2f960e6f0f9b9.tar.gz
isl-e18f50ef6f40c2325dcf07da8fc2f960e6f0f9b9.tar.bz2
isl-e18f50ef6f40c2325dcf07da8fc2f960e6f0f9b9.zip
isl_sample.c: initial_basis: set n_unbounded and n_zero
n_unbounded and n_zero are initialized to zero, but they can be set to non-zero values in isl_tab_set_initial_basis_with_cone. If isl_tab_sample is later called on an updated tab, but with the old basis removed, then these values, in particular n_unbounded, may not be valid anymore. In particular, this happens in isl_tab_pip.c's gbr_get_sample. Arguably, gbr_get_sample should reset the values of n_zero and n_unbounded when it drops the basis, but it doens't hurt for initial_basis to reset those values too.
Diffstat (limited to 'isl_tab_pip.c')
-rw-r--r--isl_tab_pip.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/isl_tab_pip.c b/isl_tab_pip.c
index a15015e6..36c3d02e 100644
--- a/isl_tab_pip.c
+++ b/isl_tab_pip.c
@@ -2620,10 +2620,9 @@ static struct isl_vec *gbr_get_sample(struct isl_context_gbr *cgbr)
if (cgbr->tab->basis->n_col != 1 + cgbr->tab->n_var) {
isl_mat_free(cgbr->tab->basis);
cgbr->tab->basis = NULL;
- } else {
- cgbr->tab->n_zero = 0;
- cgbr->tab->n_unbounded = 0;
}
+ cgbr->tab->n_zero = 0;
+ cgbr->tab->n_unbounded = 0;
}
snap = isl_tab_snap(cgbr->tab);