From 3a1500f4bdf130bfa1301b2bfe7ba4cf29bc5f0c Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 28 Jul 2015 17:36:22 +0200 Subject: [PATCH] isl_output.c: print_div: improve error handling Signed-off-by: Sven Verdoolaege --- isl_output.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/isl_output.c b/isl_output.c index 8c100d35..a46b2e22 100644 --- a/isl_output.c +++ b/isl_output.c @@ -515,7 +515,12 @@ error: static __isl_give isl_printer *print_div(__isl_keep isl_space *dim, __isl_keep isl_mat *div, int pos, __isl_take isl_printer *p) { - int c = p->output_format == ISL_FORMAT_C; + int c; + + if (!p || !div) + return isl_printer_free(p); + + c = p->output_format == ISL_FORMAT_C; p = isl_printer_print_str(p, c ? "floord(" : "floor(("); p = print_affine_of_len(dim, div, p, div->row[pos] + 1, div->n_col - 1); -- 2.11.4.GIT