isl_ast_build_init_derived: check build->domain
authorSven Verdoolaege <skimo@kotnet.org>
Fri, 30 Nov 2012 17:01:42 +0000 (18:01 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 1 Dec 2012 16:37:59 +0000 (17:37 +0100)
If something has gone wrong during the construction of the isl_ast_build,
its domain field may be NULL.  Since isl_ast_build_get_ctx obtains
the isl_ctx from this field, we should not continue if build->domain is NULL.

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

index 26aabab..fbbb5c5 100644 (file)
@@ -49,7 +49,7 @@ static __isl_give isl_ast_build *isl_ast_build_init_derived(
        isl_vec *strides;
 
        build = isl_ast_build_cow(build);
-       if (!build)
+       if (!build || !build->domain)
                goto error;
 
        ctx = isl_ast_build_get_ctx(build);