From 09bb29c8f95cc3f3ddb3acf1de645beff31ec647 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sun, 27 Jun 2010 18:50:23 +0200 Subject: [PATCH] isl_basic_map_from_constraint: only return copy of bmap on equality constraints Commit b39d157 (isl_basic_map_from_constraint: return copy of bmap in constraint if possible) changed isl_basic_map_from_constraint to return a copy when this bmap consists of a single constraint in order to handle the case where a new constraint is created with unknown existentially quantified variables. However, if the divs _are_ known, then the div definition is simply thrown away. If the single constraint is an equality, then it may be possible to recover the definition, but if it is an inequality, then this is not possible and in fact it does not make sense to have unknown divs. Therefore, only return a copy on equality constraints. --- isl_constraint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isl_constraint.c b/isl_constraint.c index 86a8215a..96a088c9 100644 --- a/isl_constraint.c +++ b/isl_constraint.c @@ -400,7 +400,7 @@ __isl_give isl_basic_map *isl_basic_map_from_constraint( if (!constraint) return NULL; - if (constraint->bmap->n_eq + constraint->bmap->n_ineq == 1) { + if (constraint->bmap->n_eq == 1 && constraint->bmap->n_ineq == 0) { bmap = isl_basic_map_copy(constraint->bmap); isl_constraint_free(constraint); return bmap; -- 2.11.4.GIT