Print this page
10703 smatch unreachable code checking needs reworking
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/parse.c
          +++ new/usr/src/tools/smatch/src/parse.c
↓ open down ↓ 2851 lines elided ↑ open up ↑
2852 2852          /* Top-level inline asm or static assertion? */
2853 2853          if (token_type(token) == TOKEN_IDENT) {
2854 2854                  struct symbol *s = lookup_keyword(token->ident, NS_KEYWORD);
2855 2855                  if (s && s->op->toplevel)
2856 2856                          return s->op->toplevel(token, list);
2857 2857          }
2858 2858  
2859 2859          /* Parse declaration-specifiers, if any */
2860 2860          token = declaration_specifiers(token, &ctx);
2861 2861          mod = storage_modifiers(&ctx);
     2862 +        mod |= ctx.ctype.modifiers & MOD_NORETURN;
2862 2863          decl = alloc_symbol(token->pos, SYM_NODE);
2863 2864          /* Just a type declaration? */
2864 2865          if (match_op(token, ';')) {
2865 2866                  apply_modifiers(token->pos, &ctx);
2866 2867                  return token->next;
2867 2868          }
2868 2869  
2869 2870          saved = ctx.ctype;
2870 2871          token = declarator(token, &ctx);
2871 2872          token = handle_attributes(token, &ctx, KW_ATTRIBUTE | KW_ASM);
↓ open down ↓ 115 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX