From 4eecdb4abb1d5b45c31c92ba354373edd01d5c8c Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sat, 7 Aug 2010 15:26:11 +0200 Subject: [PATCH] isl_union_pw_qpolynomial_add_pw_qpolynomial: don't add empty parts Signed-off-by: Sven Verdoolaege --- isl_union_templ.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/isl_union_templ.c b/isl_union_templ.c index 8495cbf..5f50ffe 100644 --- a/isl_union_templ.c +++ b/isl_union_templ.c @@ -108,9 +108,17 @@ __isl_give UNION *FN(FN(UNION,add),PARTS)(__isl_take UNION *u, uint32_t hash; struct isl_hash_table_entry *entry; + if (!part) + goto error; + + if (FN(PART,is_zero)(part)) { + FN(PART,free)(part); + return u; + } + u = FN(UNION,cow)(u); - if (!part || !u) + if (!u) goto error; isl_assert(u->dim->ctx, isl_dim_match(part->dim, isl_dim_param, u->dim, -- 2.7.4