From 80bc38a288cc2ae7dd05424f4b09ea396ce402a0 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sun, 2 Dec 2012 15:38:13 +0100 Subject: [PATCH] isl_basic_map_foreach_lexopt: avoid invalid access on error Signed-off-by: Sven Verdoolaege --- isl_tab_pip.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/isl_tab_pip.c b/isl_tab_pip.c index f69bae39..9663979a 100644 --- a/isl_tab_pip.c +++ b/isl_tab_pip.c @@ -4784,11 +4784,13 @@ int isl_basic_map_foreach_lexopt(__isl_keep isl_basic_map *bmap, int max, struct isl_sol_for *sol_for = NULL; bmap = isl_basic_map_copy(bmap); + bmap = isl_basic_map_detect_equalities(bmap); if (!bmap) return -1; - bmap = isl_basic_map_detect_equalities(bmap); sol_for = sol_for_init(bmap, max, fn, user); + if (!sol_for) + goto error; if (isl_basic_map_plain_is_empty(bmap)) /* nothing */; -- 2.11.4.GIT