Print this page
11972 resync smatch


 169 static void match_declarations(struct symbol *sym)
 170 {
 171         const char *name;
 172 
 173         if ((get_base_type(sym))->type == SYM_ARRAY)
 174                 return;
 175 
 176         if (!sym->ident)
 177                 return;
 178         name = sym->ident->name;
 179         if (!sym->initializer) {
 180                 set_state(my_id, name, sym, &uninitialized);
 181                 scoped_state(my_id, name, sym);
 182         }
 183 }
 184 
 185 static void match_assign(struct expression *expr)
 186 {
 187         struct statement *stmt;
 188 
 189         if (!is_zero(expr->right))
 190                 return;
 191 
 192         if (__in_fake_assign)
 193                 return;
 194 
 195         FOR_EACH_PTR_REVERSE(big_statement_stack, stmt) {
 196                 if (stmt->type == STMT_DECLARATION)
 197                         return;
 198                 break;
 199         } END_FOR_EACH_PTR_REVERSE(stmt);
 200 
 201         set_state_expr(my_id, expr->left, &null);
 202 }
 203 
 204 static void match_assigns_address(struct expression *expr)
 205 {
 206         struct expression *right;
 207 
 208         right = strip_expr(expr->right);
 209         if (right->type != EXPR_PREOP || right->op != '&')




 169 static void match_declarations(struct symbol *sym)
 170 {
 171         const char *name;
 172 
 173         if ((get_base_type(sym))->type == SYM_ARRAY)
 174                 return;
 175 
 176         if (!sym->ident)
 177                 return;
 178         name = sym->ident->name;
 179         if (!sym->initializer) {
 180                 set_state(my_id, name, sym, &uninitialized);
 181                 scoped_state(my_id, name, sym);
 182         }
 183 }
 184 
 185 static void match_assign(struct expression *expr)
 186 {
 187         struct statement *stmt;
 188 
 189         if (!expr_is_zero(expr->right))
 190                 return;
 191 
 192         if (__in_fake_assign)
 193                 return;
 194 
 195         FOR_EACH_PTR_REVERSE(big_statement_stack, stmt) {
 196                 if (stmt->type == STMT_DECLARATION)
 197                         return;
 198                 break;
 199         } END_FOR_EACH_PTR_REVERSE(stmt);
 200 
 201         set_state_expr(my_id, expr->left, &null);
 202 }
 203 
 204 static void match_assigns_address(struct expression *expr)
 205 {
 206         struct expression *right;
 207 
 208         right = strip_expr(expr->right);
 209         if (right->type != EXPR_PREOP || right->op != '&')