isl_{set,map}_fast_is_empty: avoid NULL pointer dereference
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 25 Jun 2010 18:36:16 +0000 (20:36 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 26 Jun 2010 15:37:39 +0000 (17:37 +0200)
isl_map.c

index 7ac2900..dd438b6 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -5197,12 +5197,12 @@ int isl_map_is_empty(struct isl_map *map)
 
 int isl_map_fast_is_empty(struct isl_map *map)
 {
-       return map->n == 0;
+       return map ? map->n == 0 : -1;
 }
 
 int isl_set_fast_is_empty(struct isl_set *set)
 {
-       return set->n == 0;
+       return set ? set->n == 0 : -1;
 }
 
 int isl_set_is_empty(struct isl_set *set)