isl_test.c: map_is_equal: check input
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 25 Jun 2010 15:08:36 +0000 (17:08 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 26 Jun 2010 15:37:38 +0000 (17:37 +0200)
isl_test.c

index 10e942a..3e121cd 100644 (file)
@@ -1092,11 +1092,14 @@ static int common_space(void *first, void *second)
        return 2 * depth;
 }
 
-int map_is_equal(__isl_keep isl_map *map, const char *str)
+static int map_is_equal(__isl_keep isl_map *map, const char *str)
 {
        isl_map *map2;
        int equal;
 
+       if (!map)
+               return -1;
+
        map2 = isl_map_read_from_str(map->ctx, str, -1);
        equal = isl_map_is_equal(map, map2);
        isl_map_free(map2);