isl_union_map.c: plain_injective_on_range: silence clang warning
authorSven Verdoolaege <skimo@kotnet.org>
Sat, 15 Sep 2012 08:21:47 +0000 (10:21 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 15 Sep 2012 08:21:47 +0000 (10:21 +0200)
Recent clangs complain that "n" may be used uninitialized in the call
to free_isl_fixed_map_array.  However, this only happens data.v is NULL,
in which case free_isl_fixed_map_array does not even look at n.

By moving the initialization of n up, we can silence this warning.

Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_union_map.c

index a2973bb..c2f1fae 100644 (file)
@@ -2228,10 +2228,10 @@ static int plain_injective_on_range(__isl_take isl_union_map *umap,
 
        ctx = isl_union_map_get_ctx(umap);
 
+       n = isl_union_map_n_map(umap);
        if (!umap)
                goto error;
 
-       n = isl_union_map_n_map(umap);
        if (n <= 1) {
                isl_union_map_free(umap);
                return 1;