isl_set_alloc: add check on number of basic sets
authorSven Verdoolaege <skimo@kotnet.org>
Tue, 9 Sep 2008 16:53:30 +0000 (18:53 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 11 Oct 2008 21:39:20 +0000 (23:39 +0200)
isl_map.c

index 400826c..3b3e462 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -1434,6 +1434,7 @@ struct isl_set *isl_set_alloc(struct isl_ctx *ctx,
 {
        struct isl_set *set;
 
+       isl_assert(ctx, n >= 0, return NULL);
        set = isl_alloc(ctx, struct isl_set,
                        sizeof(struct isl_set) +
                        n * sizeof(struct isl_basic_set *));