isl_ast_codegen.c: generate_sorted_domains: avoid invalid access on error
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 2 Dec 2012 12:23:06 +0000 (2 13:23 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 2 Dec 2012 12:23:06 +0000 (2 13:23 +0100)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_ast_codegen.c

index 1ada490..9d4d93b 100644 (file)
@@ -1737,6 +1737,8 @@ static __isl_give isl_ast_graft_list *generate_sorted_domains(
        data.depth = isl_ast_build_get_depth(build);
        data.piece = domain_list->p;
        g = isl_tarjan_graph_init(ctx, n, &domain_follows_at_depth, &data);
+       if (!g)
+               goto error;
 
        i = 0;
        while (list && n) {