From 7f9b1d8a953e3624ab04e70255705ad1baf3a61a Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 28 Jun 2013 08:34:15 +0300 Subject: [PATCH] ranges: problems parsing "s32min-(-1)[<=p2]" The ')' comes before the '[' character. Signed-off-by: Dan Carpenter --- smatch_ranges.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smatch_ranges.c b/smatch_ranges.c index 2ec6888c..c25ca47c 100644 --- a/smatch_ranges.c +++ b/smatch_ranges.c @@ -229,14 +229,14 @@ static void str_to_rl_helper(struct expression *call, struct symbol *type, char if (*c == '(') c++; max = parse_val(1, call, type, c, &c); + if (*c == ')') + c++; if (*c == '[') { arg_max = get_val_from_key(1, type, c, call, &c); if (sval_cmp(arg_max, max) < 0) max = arg_max; } add_range(rl, min, max); - if (*c == ')') - c++; if (!*c) break; if (*c != ',') { -- 2.11.4.GIT