Internally, sets are represented as maps with unnamed, unstructured
0D domains. isl_map_range takes advantage of this fact, but only
checked for 0D domains. This was correct when isl_map_range was added,
but it should have been updated when named and structured spaces were
introduced.
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
if (!map)
goto error;
- if (isl_map_dim(map, isl_dim_in) == 0)
+ if (isl_map_dim(map, isl_dim_in) == 0 &&
+ !isl_dim_is_named_or_nested(map->dim, isl_dim_in))
return (isl_set *)map;
map = isl_map_cow(map);