From 2390fd397522c757632375c5aa395831b036f225 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sun, 2 Dec 2012 15:34:09 +0100 Subject: [PATCH] isl_basic_map_eliminate_vars: avoid invalid access on error Signed-off-by: Sven Verdoolaege --- isl_map_simplify.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/isl_map_simplify.c b/isl_map_simplify.c index c3bbbc41..c83888a0 100644 --- a/isl_map_simplify.c +++ b/isl_map_simplify.c @@ -1449,6 +1449,8 @@ struct isl_basic_map *isl_basic_map_eliminate_vars( bmap = isl_basic_map_cow(bmap); for (d = pos + n - 1; d >= 0 && d >= pos; --d) bmap = remove_dependent_vars(bmap, d); + if (!bmap) + return NULL; for (d = pos + n - 1; d >= 0 && d >= total - bmap->n_div && d >= pos; --d) -- 2.11.4.GIT