summaryrefslogtreecommitdiff
path: root/isl_tab.c
diff options
context:
space:
mode:
authorSven Verdoolaege <skimo@kotnet.org>2009-07-11 15:40:41 +0200
committerSven Verdoolaege <skimo@kotnet.org>2009-07-13 23:40:12 +0200
commitedb02fef62bd0f8bf73586b95a02b8cf34366d7a (patch)
tree789c64166b986f743e203cbaa5118b3556789a49 /isl_tab.c
parent7771d25a2aa12e009227fdc209f4a203186815b2 (diff)
downloadisl-edb02fef62bd0f8bf73586b95a02b8cf34366d7a.tar.gz
isl-edb02fef62bd0f8bf73586b95a02b8cf34366d7a.tar.bz2
isl-edb02fef62bd0f8bf73586b95a02b8cf34366d7a.zip
isl_tab: don't create new undo records during rollback
Diffstat (limited to 'isl_tab.c')
-rw-r--r--isl_tab.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/isl_tab.c b/isl_tab.c
index cdb950bb..4f2e7835 100644
--- a/isl_tab.c
+++ b/isl_tab.c
@@ -51,6 +51,7 @@ struct isl_tab *isl_tab_alloc(struct isl_ctx *ctx,
tab->need_undo = 0;
tab->rational = 0;
tab->empty = 0;
+ tab->in_undo = 0;
tab->bottom.type = isl_tab_undo_bottom;
tab->bottom.next = NULL;
tab->top = &tab->bottom;
@@ -484,6 +485,8 @@ static void pivot(struct isl_ctx *ctx,
var = var_from_col(ctx, tab, col);
var->is_row = 0;
var->index = col;
+ if (tab->in_undo)
+ return;
for (i = tab->n_redundant; i < tab->n_row; ++i) {
if (isl_int_is_zero(mat->row[i][2 + col]))
continue;
@@ -1701,6 +1704,7 @@ int isl_tab_rollback(struct isl_ctx *ctx, struct isl_tab *tab,
if (!tab)
return -1;
+ tab->in_undo = 1;
for (undo = tab->top; undo && undo != &tab->bottom; undo = next) {
next = undo->next;
if (undo == snap)
@@ -1708,6 +1712,7 @@ int isl_tab_rollback(struct isl_ctx *ctx, struct isl_tab *tab,
perform_undo(ctx, tab, undo);
free(undo);
}
+ tab->in_undo = 0;
tab->top = undo;
if (!undo)
return -1;