Print this page
11972 resync smatch

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/check_access_ok_math.c
          +++ new/usr/src/tools/smatch/src/check_access_ok_math.c
↓ open down ↓ 68 lines elided ↑ open up ↑
  69   69  {
  70   70          struct expression *size_expr;
  71   71  
  72   72          size_expr = get_argument_from_call_expr(expr->args, 1);
  73   73          match_size(size_expr);
  74   74  }
  75   75  
  76   76  static void split_asm_constraints(struct expression_list *expr_list)
  77   77  {
  78   78          struct expression *expr;
  79      -        int state = 0;
  80   79          int i;
  81   80  
  82   81          i = 0;
  83   82          FOR_EACH_PTR(expr_list, expr) {
  84      -
  85      -                switch (state) {
  86      -                case 0: /* identifier */
  87      -                case 1: /* constraint */
  88      -                        state++;
  89      -                        continue;
  90      -                case 2: /* expression */
  91      -                        state = 0;
  92      -                        if (i == 1)
  93      -                                match_size(expr);
  94      -                        i++;
  95      -                        continue;
  96      -                }
       83 +                i++;
       84 +                if (expr->type != EXPR_ASM_OPERAND)
       85 +                        continue;
       86 +                if (i == 1)
       87 +                        match_size(expr->expr);
  97   88          } END_FOR_EACH_PTR(expr);
  98   89  }
  99   90  
 100   91  static void match_asm_stmt(struct statement *stmt)
 101   92  {
 102   93          char *name;
 103   94  
 104   95          name = get_macro_name(stmt->pos);
 105   96          if (!name || strcmp(name, "access_ok") != 0)
 106   97                  return;
↓ open down ↓ 13 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX