From 748e38c7301f6756a46532e8447887f4bb32768c Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sun, 23 Jan 2011 15:42:21 +0100 Subject: [PATCH] isl_map_subtract.c: n_non_redundant: propage isl_ctx Signed-off-by: Sven Verdoolaege --- isl_map_subtract.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/isl_map_subtract.c b/isl_map_subtract.c index 59df4b1..bde4c44 100644 --- a/isl_map_subtract.c +++ b/isl_map_subtract.c @@ -206,7 +206,8 @@ static int tab_freeze_constraints(struct isl_tab *tab) * Put the indices of the redundant constraints in index * and return the number of redundant constraints. */ -static int n_non_redundant(struct isl_tab *tab, int offset, int **index) +static int n_non_redundant(isl_ctx *ctx, struct isl_tab *tab, + int offset, int **index) { int i, n; int n_test = tab->n_con - offset; @@ -215,7 +216,7 @@ static int n_non_redundant(struct isl_tab *tab, int offset, int **index) return -1; if (!*index) - *index = isl_alloc_array(tab->mat->ctx, int, n_test); + *index = isl_alloc_array(ctx, int, n_test); if (!*index) return -1; @@ -278,6 +279,7 @@ static int basic_map_collect_diff(__isl_take isl_basic_map *bmap, int level; int init; int empty; + isl_ctx *ctx; struct isl_tab *tab = NULL; struct isl_tab_undo **snap = NULL; int *k = NULL; @@ -298,6 +300,7 @@ static int basic_map_collect_diff(__isl_take isl_basic_map *bmap, if (!bmap || !map) goto error; + ctx = map->ctx; snap = isl_alloc_array(map->ctx, struct isl_tab_undo *, map->n); k = isl_alloc_array(map->ctx, int, map->n); n = isl_alloc_array(map->ctx, int, map->n); @@ -365,7 +368,8 @@ static int basic_map_collect_diff(__isl_take isl_basic_map *bmap, continue; } modified = 1; - n[level] = n_non_redundant(tab, offset, &index[level]); + n[level] = n_non_redundant(ctx, tab, offset, + &index[level]); if (n[level] < 0) goto error; if (n[level] == 0) { -- 2.7.4