From 80cfd76f56336a40a61331865e581fcb02745bdc Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 5 Nov 2012 11:43:51 +0300 Subject: [PATCH] sval: fix a bug in remove_range_sval() This comparison was wrong. The test is checking wether it should remove the whole range. So if (tmp->min)-(tmp->max) is entirely within min-max, then we should continue. Signed-off-by: Dan Carpenter --- smatch_ranges.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smatch_ranges.c b/smatch_ranges.c index 623cd797..2159855a 100644 --- a/smatch_ranges.c +++ b/smatch_ranges.c @@ -626,7 +626,7 @@ struct range_list_sval *remove_range_sval(struct range_list_sval *list, sval_t m add_range_sval(&ret, tmp->min, tmp->max); continue; } - if (sval_cmp(tmp->min, min) == 0 && sval_cmp(tmp->max, max) == 0) + if (sval_cmp(tmp->min, min) >= 0 && sval_cmp(tmp->max, max) <= 0) continue; if (sval_cmp(tmp->min, min) >= 0) { max.value++; -- 2.11.4.GIT