From 75eb4b48a95f210a6158ac57068d803437547aab Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 5 Jul 2013 18:17:22 +0200 Subject: [PATCH] isl_basic_map_sort_constraints: avoid zero-size allocation Signed-off-by: Sven Verdoolaege --- isl_map.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/isl_map.c b/isl_map.c index 42672930..af999167 100644 --- a/isl_map.c +++ b/isl_map.c @@ -8711,6 +8711,8 @@ static struct isl_basic_map *isl_basic_map_sort_constraints( if (!bmap) return NULL; + if (bmap->n_ineq == 0) + return bmap; total = isl_basic_map_total_dim(bmap); c = isl_alloc_array(bmap->ctx, struct constraint, bmap->n_ineq); if (!c) -- 2.11.4.GIT