From: Sven Verdoolaege Date: Mon, 30 Jan 2012 14:23:18 +0000 (+0100) Subject: schedule.c: split_parallel: avoid invalid memory accesses X-Git-Tag: isl-0.10~8^2~29 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1b2fdb66ffd371c89f3ebeb0d06a3eef97a967ce;p=platform%2Fupstream%2Fisl.git schedule.c: split_parallel: avoid invalid memory accesses The original code incorrectly assumed that the schedules for all statements have the same number of columns, i.e., that the dimensions of the iteration domains of all statements are the same. We fix this up by simply bailing out if we find this assumption not to hold. We will improve the applicability of the transformation performed by split_parallel in a subsequent patch. Signed-off-by: Sven Verdoolaege --- diff --git a/isl_schedule.c b/isl_schedule.c index 175ed0a..65573f5 100644 --- a/isl_schedule.c +++ b/isl_schedule.c @@ -2252,6 +2252,8 @@ static int split_parallel(isl_ctx *ctx, struct isl_sched_graph *graph) for (i = 1; i < graph->n; ++i) { struct isl_sched_node *node = &graph->node[i]; + if (isl_mat_cols(node->sched) != cols) + return 0; if (!isl_seq_eq(node0->sched->row[row] + 1, node->sched->row[row] + 1, cols - 1)) return 0;