isl_map_from_pw_aff: handle NULL input
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 9 Dec 2011 18:51:06 +0000 (19:51 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 10 Dec 2011 18:42:28 +0000 (19:42 +0100)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_aff.c

index 9a6ce14..c1f5557 100644 (file)
--- a/isl_aff.c
+++ b/isl_aff.c
@@ -1411,6 +1411,8 @@ static __isl_give isl_map *map_from_pw_aff(__isl_take isl_pw_aff *pwaff)
  */
 __isl_give isl_map *isl_map_from_pw_aff(__isl_take isl_pw_aff *pwaff)
 {
+       if (!pwaff)
+               return NULL;
        if (isl_space_is_set(pwaff->dim))
                isl_die(isl_pw_aff_get_ctx(pwaff), isl_error_invalid,
                        "space of input is not a map",