isl_ast_codegen.c: create_node: avoid invalid access on error
[platform/upstream/isl.git] / isl_reordering.c
index d99d7ac..e824f21 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,
@@ -182,6 +182,9 @@ __isl_give isl_reordering *isl_reordering_extend_space(
 
        isl_reordering_free(exp);
 
+       if (!res->dim)
+               return isl_reordering_free(res);
+
        return res;
 error:
        isl_reordering_free(exp);