From 02b2b6f2298d6beca919692219a287986e984347 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 9 Apr 2013 17:37:46 +0200 Subject: [PATCH] isl_schedule.c: sort_band_list: take into account that parent may be NULL We missed this in 81bf4c2 (isl_schedule_get_band_forest: sort bands in band list, Tue Feb 26 12:35:16 2013 +0100). Signed-off-by: Sven Verdoolaege --- isl_schedule.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/isl_schedule.c b/isl_schedule.c index 9e6e617b..d1f8e669 100644 --- a/isl_schedule.c +++ b/isl_schedule.c @@ -3279,7 +3279,8 @@ static int cmp_band(const void *a, const void *b, void *user) * * If there is only one element in the list, then there is no need to sort * anything. - * If partial schedule of the parent has more than one member, then it's + * If the partial schedule of the parent has more than one member + * (or if there is no parent), then it's * defnitely not assigning constant values to the different children in * the list and so we wouldn't be able to use it to sort the list. */ @@ -3292,7 +3293,7 @@ static __isl_give isl_band_list *sort_band_list(__isl_take isl_band_list *list, return NULL; if (list->n <= 1) return list; - if (parent->n != 1) + if (!parent || parent->n != 1) return list; data.r = 0; -- 2.11.4.GIT