isl_map_n_{in,out,param}: handle NULL input
authorSven Verdoolaege <skimo@kotnet.org>
Mon, 18 Jul 2011 15:10:16 +0000 (17:10 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 20 Jul 2011 08:34:28 +0000 (10:34 +0200)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_map.c

index 3d30064..1e75c54 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -161,17 +161,17 @@ unsigned isl_basic_map_total_dim(const struct isl_basic_map *bmap)
 
 unsigned isl_map_n_in(const struct isl_map *map)
 {
-       return map->dim->n_in;
+       return map ? map->dim->n_in : 0;
 }
 
 unsigned isl_map_n_out(const struct isl_map *map)
 {
-       return map->dim->n_out;
+       return map ? map->dim->n_out : 0;
 }
 
 unsigned isl_map_n_param(const struct isl_map *map)
 {
-       return map->dim->nparam;
+       return map ? map->dim->nparam : 0;
 }
 
 int isl_map_compatible_domain(struct isl_map *map, struct isl_set *set)