isl_mat_extend: make sure the number of rows never decreases
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 6 Aug 2009 14:15:56 +0000 (16:15 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Fri, 7 Aug 2009 10:52:43 +0000 (12:52 +0200)
isl_mat.c

index c1ba26e..c96017e 100644 (file)
--- a/isl_mat.c
+++ b/isl_mat.c
@@ -57,6 +57,8 @@ struct isl_mat *isl_mat_extend(struct isl_mat *mat,
        if (mat->max_col < n_col) {
                struct isl_mat *new_mat;
 
+               if (n_row < mat->n_row)
+                       n_row = mat->n_row;
                new_mat = isl_mat_alloc(mat->ctx, n_row, n_col);
                if (!new_mat)
                        goto error;