diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-17 03:59:47 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-25 23:19:12 +0200 |
commit | e7dad08db283421a46c138f6aaee19505a96bc19 (patch) | |
tree | 73be94ab3945d15b57f0287b0b4a329e62b96468 | |
parent | ab77399f33b800f0a1568e512e86df71dd70f566 (diff) | |
download | sparse-e7dad08db283421a46c138f6aaee19505a96bc19.tar.gz |
use lookup_keyword() for qualifiers
When handling qualifiers, the corresponding symbol is looked-up with
lookup_symbol() then it's checked if the symbol's type is SYM_KEYWORD.
But, only if the identifier is a keyword (struct ident::keyword) can
the symbol be a SYM_KEYWORD. Thus, non-keyword can be filtered-out
early by using lookup_keyword().
So change the call to lookup_symbol() by a call to lookup_keyword().
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | parse.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1618,7 +1618,7 @@ struct symbol *ctype_integer(int size, int want_unsigned) static struct token *handle_qualifiers(struct token *t, struct decl_state *ctx) { while (token_type(t) == TOKEN_IDENT) { - struct symbol *s = lookup_symbol(t->ident, NS_TYPEDEF); + struct symbol *s = lookup_keyword(t->ident, NS_TYPEDEF); if (!s) break; if (s->type != SYM_KEYWORD) |