From 1eafe2e08ad05bfa199ccebb8e5c40681d3a7e9b Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 9 Nov 2016 12:27:04 +0300 Subject: [PATCH] ranges: read u64max correctly Using strtoll() truncates it to s64max which is totally wrong... I guess this has never worked? 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 9908bd16..6ef47a4b 100644 --- a/smatch_ranges.c +++ b/smatch_ranges.c @@ -358,6 +358,8 @@ static sval_t parse_val(int use_max, struct expression *call, struct symbol *typ } else if (start[0] == '[') { /* this parses [==p0] comparisons */ get_val_from_key(1, type, start, call, &c, &ret); + } else if (type_positive_bits(type) == 64) { + ret = sval_type_val(type, strtoull(start, &c, 10)); } else { ret = sval_type_val(type, strtoll(start, &c, 10)); } -- 2.11.4.GIT