Print this page
new smatch

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/check_check_deref.c
          +++ new/usr/src/tools/smatch/src/check_check_deref.c
↓ open down ↓ 127 lines elided ↑ open up ↑
 128  128                  goto free;
 129  129  
 130  130          check_dereference_name_sym(name, sym);
 131  131  free:
 132  132          free_string(name);
 133  133  }
 134  134  
 135  135  static void match_condition(struct expression *expr)
 136  136  {
 137  137          struct smatch_state *true_state = NULL;
      138 +        char *name;
 138  139  
 139      -        if (get_macro_name(expr->pos))
      140 +        name = get_macro_name(expr->pos);
      141 +        if (name &&
      142 +            (strcmp(name, "likely") != 0 && strcmp(name, "unlikely") != 0))
 140  143                  return;
 141  144  
 142  145          if (!is_pointer(expr))
 143  146                  return;
 144  147  
 145  148          if (expr->type == EXPR_ASSIGNMENT) {
 146  149                  match_condition(expr->right);
 147  150                  match_condition(expr->left);
 148  151          }
 149  152  
↓ open down ↓ 19 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX