From a61eefe217eb4fb7658433350dcb856b1cbbf91f Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 22 May 2013 13:09:33 +0300 Subject: [PATCH] math: for bitwise AND only use it for IMPLIED and ABSOLUTE Code like this: __smatch_implied(foo & 0xf); is "0-15". But: __smatch_fuzzy_max(foo & 0xf); should just say it's unknown. The original sval code it was like this as well. Otherwise it causes a lot of array overflow false positives. Signed-off-by: Dan Carpenter --- smatch_math.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smatch_math.c b/smatch_math.c index cb99d464..6f2a8abf 100644 --- a/smatch_math.c +++ b/smatch_math.c @@ -238,7 +238,7 @@ static struct range_list *handle_bitwise_AND(struct expression *expr, int implie struct symbol *type; struct range_list *left_rl, *right_rl; - if (implied == RL_EXACT) + if (implied != RL_IMPLIED && implied != RL_ABSOLUTE) return NULL; type = get_type(expr); -- 2.11.4.GIT