From 7dfd5842d85953dcf31460087c4af66cb3f8a7f6 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 4 Sep 2014 12:34:19 +0300 Subject: [PATCH] ranges: a pointer to an array is just a pointer Say you have: char buf[10]; char *p = buf; The the type of "buf" is a SYM_ARRAY and p should be in range long min to long max. Before it could be something weird. Signed-off-by: Dan Carpenter --- smatch_ranges.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/smatch_ranges.c b/smatch_ranges.c index f86e198b..7b14ed47 100644 --- a/smatch_ranges.c +++ b/smatch_ranges.c @@ -366,6 +366,8 @@ struct range_list *alloc_whole_rl(struct symbol *type) { if (!type || type_positive_bits(type) < 0) type = &llong_ctype; + if (type->type == SYM_ARRAY) + type = &ptr_ctype; return alloc_rl(sval_type_min(type), sval_type_max(type)); } -- 2.11.4.GIT