isl_qpolynomial_from_aff: create private copy of divs
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 20 May 2011 10:02:03 +0000 (12:02 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 20 May 2011 13:10:00 +0000 (15:10 +0200)
Otherwise, reduce_divs could end up modifying the divs of the input isl_aff.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_polynomial.c

index 046b63a..ff3196f 100644 (file)
@@ -2973,6 +2973,7 @@ __isl_give isl_qpolynomial *isl_qpolynomial_from_aff(__isl_take isl_aff *aff)
 
        isl_mat_free(qp->div);
        qp->div = isl_mat_copy(aff->ls->div);
+       qp->div = isl_mat_cow(qp->div);
        if (!qp->div)
                goto error;