isl_test.c: test_output: avoid invalid access on error
authorSven Verdoolaege <skimo@kotnet.org>
Thu, 29 Nov 2012 21:53:30 +0000 (22:53 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Sat, 1 Dec 2012 16:38:07 +0000 (17:38 +0100)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
isl_test.c

index 4532afa..603622d 100644 (file)
@@ -2969,7 +2969,10 @@ int test_output(isl_ctx *ctx)
        s = isl_printer_get_str(p);
        isl_printer_free(p);
        isl_pw_aff_free(pa);
-       equal = !strcmp(s, "(2 - x + 4*floord(x, 4) >= 0) ? (1) : 2");
+       if (!s)
+               equal = -1;
+       else
+               equal = !strcmp(s, "(2 - x + 4*floord(x, 4) >= 0) ? (1) : 2");
        free(s);
        if (equal < 0)
                return -1;