From 665eaee653bc15f6d9923d41b4f53aa0517235f3 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Thu, 1 May 2014 12:59:40 +0200 Subject: [PATCH] isl_local_space_intersect: add missing isl_local_space_cow when divs change Reported-by: Michael Kruse Signed-off-by: Sven Verdoolaege --- isl_local_space.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/isl_local_space.c b/isl_local_space.c index d3ca57a2..76226cfc 100644 --- a/isl_local_space.c +++ b/isl_local_space.c @@ -653,6 +653,7 @@ __isl_give isl_local_space *isl_local_space_intersect( int *exp1 = NULL; int *exp2 = NULL; isl_mat *div; + int equal; if (!ls1 || !ls2) goto error; @@ -681,6 +682,14 @@ __isl_give isl_local_space *isl_local_space_intersect( if (!div) goto error; + equal = isl_mat_is_equal(ls1->div, div); + if (equal < 0) + goto error; + if (!equal) + ls1 = isl_local_space_cow(ls1); + if (!ls1) + goto error; + free(exp1); free(exp2); isl_local_space_free(ls2); -- 2.11.4.GIT