diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-19 16:45:19 +0200 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-07-25 23:19:12 +0200 |
commit | 3832167298fa0e9329bf1dd4d78cb47e6179493d (patch) | |
tree | 65950fb6afd9e2dfa1b4da7735bf5ff5d2cd0507 | |
parent | f009179a05f74118549e4810c0681b4848e374d6 (diff) | |
download | sparse-3832167298fa0e9329bf1dd4d78cb47e6179493d.tar.gz |
testing for sym->op is unneeded for lookup_keyword()
All symbols returned by lookup_keyword() are of type SYM_KEYWORD,
because either:
1) it's in NS_KEYWORD (and all symbol in NS_KEYWORD are SYM_KEYWORD)
2) it's in NS_TYPEDEF and all *keywords* in NS_TYPEDEF are reserved
and so can't be user defined and so must be SYM_KEYWORD.
Thus, they all have a symbol_op associated to them and it's
unneeded to test it.
So, remove the unneeded test.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | parse.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2160,7 +2160,7 @@ static struct token *parse_asm_statement(struct token *token, struct statement * stmt->type = STMT_ASM; while (token_type(token) == TOKEN_IDENT) { struct symbol *s = lookup_keyword(token->ident, NS_TYPEDEF); - if (s && s->op && s->op->asm_modifier) + if (s && s->op->asm_modifier) s->op->asm_modifier(token, &mods); else if (token->ident == &goto_ident) asm_modifier(token, &mods, MOD_ASM_GOTO); |