X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=isl_union_templ.c;h=5f50ffe3d847a127895daea6caa446d369e2e6a6;hb=4eecdb4abb1d5b45c31c92ba354373edd01d5c8c;hp=8495cbf72dd3cef3974aadbf3d168a12a940aa9d;hpb=e6a47861b2ef8c2b5a52b5da4975bb0de1d5ca0b;p=platform%2Fupstream%2Fisl.git 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,