add isl_aff_mod_val
[platform/upstream/isl.git] / isl_lp_piplib.c
index 7ee0bec..c95af4c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2008-2009 Katholieke Universiteit Leuven
  *
- * Use of this software is governed by the GNU LGPLv2.1 license
+ * Use of this software is governed by the MIT license
  *
  * Written by Sven Verdoolaege, K.U.Leuven, Departement
  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
@@ -84,8 +84,10 @@ enum isl_lp_result isl_pip_solve_lp(struct isl_basic_map *bmap, int maximize,
        if (!sol)
                goto error;
 
-       if (vec)
-               *vec = isl_vec_alloc(bmap->ctx, 1 + total);
+       if (vec) {
+               isl_ctx *ctx = isl_basic_map_get_ctx(bmap);
+               *vec = isl_vec_alloc(ctx, 1 + total);
+       }
        if (vec && !*vec)
                res = isl_lp_error;
        else if (!sol->list)