From 34eb3a0c3d52875ec93e926f12713feff4d08af0 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Wed, 4 Dec 2013 10:49:21 +0100 Subject: [PATCH] isl_pw_*_pullback_pw_multi_aff: properly handle empty input In particular, make sure the result lives in the correct space. Signed-off-by: Sven Verdoolaege --- isl_pw_templ.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/isl_pw_templ.c b/isl_pw_templ.c index 3921c812..7c76fece 100644 --- a/isl_pw_templ.c +++ b/isl_pw_templ.c @@ -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; } -- 2.11.4.GIT