isl_pw_*_pullback_pw_multi_aff: properly handle empty input
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 4 Dec 2013 09:49:21 +0000 (4 10:49 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 4 Dec 2013 12:16:35 +0000 (4 13:16 +0100)
In particular, make sure the result lives in the correct space.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_pw_templ.c

index 3921c81..7c76fec 100644 (file)
@@ -1829,8 +1829,11 @@ static __isl_give PW *FN(PW,pullback_pw_multi_aff_aligned)(__isl_take PW *pw,
                goto error;
 
        if (pma->n == 0) {
+               isl_space *space;
+               space = isl_space_join(isl_pw_multi_aff_get_space(pma),
+                                       FN(PW,get_space)(pw));
                isl_pw_multi_aff_free(pma);
-               res = FN(PW,empty)(FN(PW,get_space)(pw));
+               res = FN(PW,empty)(space);
                FN(PW,free)(pw);
                return res;
        }