From: Sven Verdoolaege Date: Sat, 11 Jul 2009 13:40:41 +0000 (+0200) Subject: isl_tab: don't create new undo records during rollback X-Git-Tag: isl-0.01~154 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=edb02fef62bd0f8bf73586b95a02b8cf34366d7a;p=platform%2Fupstream%2Fisl.git isl_tab: don't create new undo records during rollback --- diff --git a/isl_tab.c b/isl_tab.c index cdb950b..4f2e783 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; diff --git a/isl_tab.h b/isl_tab.h index 1df42e1..e747a9f 100644 --- a/isl_tab.h +++ b/isl_tab.h @@ -93,6 +93,7 @@ struct isl_tab { unsigned need_undo : 1; unsigned rational : 1; unsigned empty : 1; + unsigned in_undo : 1; }; struct isl_tab *isl_tab_alloc(struct isl_ctx *ctx,