From 11927df08e42876dd1d2df20c1c436f40551afaa Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 17 Apr 2012 12:50:27 +0200 Subject: [PATCH] isl_basic_map_insert: preserve emptiness isl_basic_map_plain_is_empty doesn't look at the constraints but only at the ISL_BASIC_MAP_EMPTY flag. We therefore need to make sure the flag is set on the output of isl_basic_map_insert if it was set on the input. Signed-off-by: Sven Verdoolaege --- isl_map.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/isl_map.c b/isl_map.c index e0defa73..8c205b0c 100644 --- a/isl_map.c +++ b/isl_map.c @@ -2696,6 +2696,10 @@ __isl_give isl_basic_map *isl_basic_map_insert(__isl_take isl_basic_map *bmap, bmap->n_div, bmap->n_eq, bmap->n_ineq); if (isl_basic_map_is_rational(bmap)) res = isl_basic_map_set_rational(res); + if (isl_basic_map_plain_is_empty(bmap)) { + isl_basic_map_free(bmap); + return isl_basic_map_set_to_empty(res); + } res = isl_basic_map_add_constraints_dim_map(res, bmap, dim_map); return isl_basic_map_finalize(res); } -- 2.11.4.GIT