From 0da61e50f990d46cd3b7c5a37fcfbca30c1276f4 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Mon, 18 Jul 2011 17:10:16 +0200 Subject: [PATCH] isl_map_n_{in,out,param}: handle NULL input Signed-off-by: Sven Verdoolaege --- isl_map.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/isl_map.c b/isl_map.c index 3d30064..1e75c54 100644 --- 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) -- 2.7.4