From: Sven Verdoolaege Date: Thu, 1 May 2014 10:59:40 +0000 (+0200) Subject: isl_local_space_intersect: add missing isl_local_space_cow when divs change X-Git-Tag: isl-0.14~3^2~28 X-Git-Url: https://repo.or.cz/w/isl.git/commitdiff_plain/665eaee653bc15f6d9923d41b4f53aa0517235f3 isl_local_space_intersect: add missing isl_local_space_cow when divs change Reported-by: Michael Kruse Signed-off-by: Sven Verdoolaege --- 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);