summaryrefslogtreecommitdiff
path: root/isl_tab_pip.c
diff options
context:
space:
mode:
authorSven Verdoolaege <skimo@kotnet.org>2011-10-20 20:18:57 +0200
committerSven Verdoolaege <skimo@kotnet.org>2011-10-20 20:22:15 +0200
commit60063f1a3c92cecf05d9f4969f4ad564c7075513 (patch)
treecbd2c4ea543ab3c71d141290cd6229137740b643 /isl_tab_pip.c
parent35a22685d018650b906802890787cbff142e9ec1 (diff)
downloadisl-60063f1a3c92cecf05d9f4969f4ad564c7075513.tar.gz
isl-60063f1a3c92cecf05d9f4969f4ad564c7075513.tar.bz2
isl-60063f1a3c92cecf05d9f4969f4ad564c7075513.zip
isl_tab_pip.c: set_row_cst_to_div: don't assume coefficient of div is zero
The function is supposed to increment the coefficient of the given div by one, but instead it would simply set the coefficient to one. This is fine if the div is new and therefore has a zero coefficient, but it does not work if the div already appeared in the constraint. Reported-by: Armin Größlinger <armin.groesslinger@uni-passau.de> Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
Diffstat (limited to 'isl_tab_pip.c')
-rw-r--r--isl_tab_pip.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/isl_tab_pip.c b/isl_tab_pip.c
index 9f9bdb1e..8c0dedc4 100644
--- a/isl_tab_pip.c
+++ b/isl_tab_pip.c
@@ -859,7 +859,8 @@ static struct isl_tab *set_row_cst_to_div(struct isl_tab *tab, int row, int div)
} else {
int dcol = tab->var[tab->n_var - tab->n_div + div].index;
- isl_int_set_si(tab->mat->row[row][2 + tab->M + dcol], 1);
+ isl_int_add_ui(tab->mat->row[row][2 + tab->M + dcol],
+ tab->mat->row[row][2 + tab->M + dcol], 1);
}
return tab;