isl_dim_flatten: remove space names when internal structure changes
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 17 Oct 2010 09:05:28 +0000 (11:05 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 17 Oct 2010 09:06:55 +0000 (11:06 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_dim.c

index a04fd97..415b659 100644 (file)
--- a/isl_dim.c
+++ b/isl_dim.c
@@ -1095,10 +1095,10 @@ __isl_give isl_dim *isl_dim_flatten(__isl_take isl_dim *dim)
        if (!dim->nested[0] && !dim->nested[1])
                return dim;
 
-       isl_dim_free(dim->nested[0]);
-       dim->nested[0] = NULL;
-       isl_dim_free(dim->nested[1]);
-       dim->nested[1] = NULL;
+       if (dim->nested[0])
+               dim = isl_dim_reset(dim, isl_dim_in);
+       if (dim && dim->nested[1])
+               dim = isl_dim_reset(dim, isl_dim_out);
 
        return dim;
 }