isl_basic_map_gist: avoid invalid access on error path
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 5 Jun 2013 07:53:19 +0000 (09:53 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 5 Jun 2013 07:53:19 +0000 (09:53 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_map_simplify.c

index 47b13c0..db0d6f8 100644 (file)
@@ -2152,6 +2152,8 @@ struct isl_basic_map *isl_basic_map_gist(struct isl_basic_map *bmap,
 
        bmap = isl_basic_map_remove_redundancies(bmap);
        context = isl_basic_map_remove_redundancies(context);
+       if (!context)
+               goto error;
 
        if (context->n_eq)
                bmap = normalize_divs_in_context(bmap, context);