Print this page
11506 smatch resync


 122                 return NULL;
 123         end_type = strchr(arg_ptr, '>');
 124         if (!end_type)
 125                 return NULL;
 126         end_type++;
 127         fn_str = expr_to_var_sym(expr, &tmp_sym);
 128         if (!fn_str || !tmp_sym)
 129                 return NULL;
 130         len_ptr = strlen(fn_member);
 131         len_str = strlen(fn_str);
 132         while (len_str > 0 && len_ptr > 0) {
 133                 if (fn_str[len_str - 1] != fn_member[len_ptr - 1])
 134                         break;
 135                 if (fn_str[len_str - 1] == '>')
 136                         break;
 137                 len_str--;
 138                 len_ptr--;
 139         }
 140 
 141         strncpy(buf, fn_str, sizeof(buf));
 142         snprintf(buf + len_str, sizeof(buf) - len_str, end_type);
 143         *sym = tmp_sym;
 144         return alloc_string(buf);
 145 }
 146 
 147 static void match_assign_function(struct expression *expr)
 148 {
 149         struct expression *right, *arg;
 150         struct symbol *sym;
 151         char *data_member;
 152         struct symbol *type;
 153         char *member_name;
 154 
 155         right = strip_expr(expr->right);
 156         if (right->type == EXPR_PREOP && right->op == '&')
 157                 right = strip_expr(right->unop);
 158 
 159         type = get_type(right);
 160         if (type && type->type == SYM_PTR)
 161                 type = get_real_base_type(type);
 162         if (!type || type->type != SYM_FN)




 122                 return NULL;
 123         end_type = strchr(arg_ptr, '>');
 124         if (!end_type)
 125                 return NULL;
 126         end_type++;
 127         fn_str = expr_to_var_sym(expr, &tmp_sym);
 128         if (!fn_str || !tmp_sym)
 129                 return NULL;
 130         len_ptr = strlen(fn_member);
 131         len_str = strlen(fn_str);
 132         while (len_str > 0 && len_ptr > 0) {
 133                 if (fn_str[len_str - 1] != fn_member[len_ptr - 1])
 134                         break;
 135                 if (fn_str[len_str - 1] == '>')
 136                         break;
 137                 len_str--;
 138                 len_ptr--;
 139         }
 140 
 141         strncpy(buf, fn_str, sizeof(buf));
 142         snprintf(buf + len_str, sizeof(buf) - len_str, "%s", end_type);
 143         *sym = tmp_sym;
 144         return alloc_string(buf);
 145 }
 146 
 147 static void match_assign_function(struct expression *expr)
 148 {
 149         struct expression *right, *arg;
 150         struct symbol *sym;
 151         char *data_member;
 152         struct symbol *type;
 153         char *member_name;
 154 
 155         right = strip_expr(expr->right);
 156         if (right->type == EXPR_PREOP && right->op == '&')
 157                 right = strip_expr(right->unop);
 158 
 159         type = get_type(right);
 160         if (type && type->type == SYM_PTR)
 161                 type = get_real_base_type(type);
 162         if (!type || type->type != SYM_FN)