From: Dan Carpenter Date: Fri, 28 Jun 2013 05:34:15 +0000 (+0300) Subject: ranges: problems parsing "s32min-(-1)[<=p2]" X-Git-Tag: 1.59~28 X-Git-Url: https://repo.or.cz/w/smatch.git/commitdiff_plain/7f9b1d8a953e3624ab04e70255705ad1baf3a61a ranges: problems parsing "s32min-(-1)[<=p2]" The ')' comes before the '[' character. Signed-off-by: Dan Carpenter --- 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 != ',') {