ranges: problems parsing "s32min-(-1)[<=p2]"
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 28 Jun 2013 05:34:15 +0000 (28 08:34 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Fri, 28 Jun 2013 05:34:15 +0000 (28 08:34 +0300)
The ')' comes before the '[' character.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_ranges.c

index 2ec6888..c25ca47 100644 (file)
@@ -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 != ',') {