isl_basic_set_opt: avoid invalid access on error path
[platform/upstream/isl.git] / isl_scan.c
index 76ab545..bc239c8 100644 (file)
@@ -1,17 +1,18 @@
 /*
  * 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
  */
 
+#include <isl_ctx_private.h>
+#include <isl_map_private.h>
 #include "isl_basis_reduction.h"
 #include "isl_scan.h"
 #include <isl/seq.h>
 #include "isl_tab.h"
-#include <isl_map_private.h>
 
 struct isl_counter {
        struct isl_scan_callback callback;
@@ -123,7 +124,7 @@ int isl_basic_set_scan(struct isl_basic_set *bset,
        if (!min || !max || !snap)
                goto error;
 
-       tab = isl_tab_from_basic_set(bset);
+       tab = isl_tab_from_basic_set(bset, 0);
        if (!tab)
                goto error;
        if (isl_tab_extend_cons(tab, dim + 1) < 0)