X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=isl_map_subtract.c;h=2c958c766f9e801469503df13f95fa4d976a9edb;hb=ca90b151a05f17ccc1c3215ff24dc5d7b9198ff4;hp=f5ed8d658075e27c0bdc23bc068ef97befc8851d;hpb=c292a3c9e8eaaae427abdfb0964c86767f3a390a;p=platform%2Fupstream%2Fisl.git diff --git a/isl_map_subtract.c b/isl_map_subtract.c index f5ed8d6..2c958c7 100644 --- a/isl_map_subtract.c +++ b/isl_map_subtract.c @@ -1,7 +1,7 @@ /* * Copyright 2008-2009 Katholieke Universiteit Leuven * - * Use of this software is governed by the GNU LGPLv2.1 license + * Use of this software is governed by the MIT license * * Written by Sven Verdoolaege, K.U.Leuven, Departement * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium @@ -326,6 +326,8 @@ static int basic_map_collect_diff(__isl_take isl_basic_map *bmap, map = isl_map_order_divs(map); tab = isl_tab_from_basic_map(bmap, 1); + if (!tab) + goto error; modified = 0; level = 0; @@ -775,6 +777,8 @@ static int map_is_singleton_subset(__isl_keep isl_map *map1, static int map_is_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2) { int is_subset = 0; + int empty; + int rat1, rat2; if (!map1 || !map2) return -1; @@ -782,10 +786,23 @@ static int map_is_subset(__isl_keep isl_map *map1, __isl_keep isl_map *map2) if (!isl_map_has_equal_space(map1, map2)) return 0; - if (isl_map_is_empty(map1)) + empty = isl_map_is_empty(map1); + if (empty < 0) + return -1; + if (empty) return 1; - if (isl_map_is_empty(map2)) + empty = isl_map_is_empty(map2); + if (empty < 0) + return -1; + if (empty) + return 0; + + rat1 = isl_map_has_rational(map1); + rat2 = isl_map_has_rational(map2); + if (rat1 < 0 || rat2 < 0) + return -1; + if (rat1 && !rat2) return 0; if (isl_map_plain_is_universe(map2))