isl_basic_set_opt: avoid invalid access on error path
[platform/upstream/isl.git] / isl_fold.c
index 98a91ae..ba93a69 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2010      INRIA Saclay
  *
- * 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, INRIA Saclay - Ile-de-France,
  * Parc Club Orsay Universite, ZAC des vignes, 4 rue Jacques Monod,
@@ -611,6 +611,15 @@ error:
        return NULL;
 }
 
+__isl_give isl_qpolynomial_fold *isl_qpolynomial_fold_gist_params(
+       __isl_take isl_qpolynomial_fold *fold, __isl_take isl_set *context)
+{
+       isl_space *space = isl_qpolynomial_fold_get_domain_space(fold);
+       isl_set *dom_context = isl_set_universe(space);
+       dom_context = isl_set_intersect_params(dom_context, context);
+       return isl_qpolynomial_fold_gist(fold, dom_context);
+}
+
 #define HAS_TYPE
 
 #undef PW
@@ -625,8 +634,11 @@ error:
 #define IS_ZERO is_zero
 #undef FIELD
 #define FIELD fold
+#undef DEFAULT_IS_ZERO
+#define DEFAULT_IS_ZERO 1
 
 #define NO_NEG
+#define NO_PULLBACK
 
 #include <isl_pw_templ.c>
 
@@ -959,6 +971,13 @@ __isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_from_pw_qpolynomial(
        return pwf;
 }
 
+__isl_give isl_pw_qpolynomial_fold *isl_pw_qpolynomial_fold_add(
+       __isl_take isl_pw_qpolynomial_fold *pwf1,
+       __isl_take isl_pw_qpolynomial_fold *pwf2)
+{
+       return isl_pw_qpolynomial_fold_union_add_(pwf1, pwf2);
+}
+
 int isl_qpolynomial_fold_plain_is_equal(__isl_keep isl_qpolynomial_fold *fold1,
        __isl_keep isl_qpolynomial_fold *fold2)
 {