From 4e7ab145e0bbf16b55f7848517aa3b787ebeb2af Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Tue, 28 Jan 2014 17:15:05 +0100 Subject: [PATCH] isl_aff_set_coefficient_si: fix out-of-bounds check Signed-off-by: Sven Verdoolaege --- isl_aff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isl_aff.c b/isl_aff.c index 84d264b9..d7ef2df3 100644 --- a/isl_aff.c +++ b/isl_aff.c @@ -750,7 +750,7 @@ __isl_give isl_aff *isl_aff_set_coefficient_si(__isl_take isl_aff *aff, if (type == isl_dim_in) type = isl_dim_set; - if (pos >= isl_local_space_dim(aff->ls, type)) + if (pos < 0 || pos >= isl_local_space_dim(aff->ls, type)) isl_die(aff->v->ctx, isl_error_invalid, "position out of bounds", return isl_aff_free(aff)); -- 2.11.4.GIT