isl_basic_set_swap_vars: handle NULL input
authorSven Verdoolaege <skimo@kotnet.org>
Sun, 2 Dec 2012 11:19:40 +0000 (12:19 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sun, 2 Dec 2012 11:23:44 +0000 (12:23 +0100)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_map.c

index 28c35d2..a22fc94 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -1620,6 +1620,9 @@ static __isl_give isl_basic_set *isl_basic_set_swap_vars(
        unsigned dim;
        unsigned nparam;
 
+       if (!bset)
+               return NULL;
+
        nparam = isl_basic_set_n_param(bset);
        dim = isl_basic_set_n_dim(bset);
        isl_assert(bset->ctx, n <= dim, goto error);