Print this page
12257 resync smatch to 0.6.1-rc1-il-4

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/smatch.h
          +++ new/usr/src/tools/smatch/src/smatch.h
↓ open down ↓ 96 lines elided ↑ open up ↑
  97   97  };
  98   98  DECLARE_ALLOCATOR(var_sym);
  99   99  DECLARE_PTR_LIST(var_sym_list, struct var_sym);
 100  100  
 101  101  struct constraint {
 102  102          int op;
 103  103          int id;
 104  104  };
 105  105  DECLARE_PTR_LIST(constraint_list, struct constraint);
 106  106  
      107 +struct alloc_info {
      108 +        const char *fn;
      109 +        int size_param, nr;
      110 +};
      111 +extern struct alloc_info *alloc_funcs;
      112 +
 107  113  struct bit_info {
 108  114          unsigned long long set;
 109  115          unsigned long long possible;
 110  116  };
 111  117  
 112  118  enum hook_type {
 113  119          EXPR_HOOK,
 114  120          EXPR_HOOK_AFTER,
 115  121          STMT_HOOK,
 116  122          STMT_HOOK_AFTER,
↓ open down ↓ 274 lines elided ↑ open up ↑
 391  397  char *expr_to_var_sym(struct expression *expr,
 392  398                               struct symbol **sym_ptr);
 393  399  char *expr_to_known_chunk_sym(struct expression *expr, struct symbol **sym);
 394  400  char *expr_to_chunk_sym_vsl(struct expression *expr, struct symbol **sym, struct var_sym_list **vsl);
 395  401  int get_complication_score(struct expression *expr);
 396  402  
 397  403  int sym_name_is(const char *name, struct expression *expr);
 398  404  int get_const_value(struct expression *expr, sval_t *sval);
 399  405  int get_value(struct expression *expr, sval_t *val);
 400  406  int get_implied_value(struct expression *expr, sval_t *val);
      407 +int get_implied_value_fast(struct expression *expr, sval_t *sval);
 401  408  int get_implied_min(struct expression *expr, sval_t *sval);
 402  409  int get_implied_max(struct expression *expr, sval_t *val);
 403  410  int get_hard_max(struct expression *expr, sval_t *sval);
 404  411  int get_fuzzy_min(struct expression *expr, sval_t *min);
 405  412  int get_fuzzy_max(struct expression *expr, sval_t *max);
 406  413  int get_absolute_min(struct expression *expr, sval_t *sval);
 407  414  int get_absolute_max(struct expression *expr, sval_t *sval);
 408  415  int parse_call_math(struct expression *expr, char *math, sval_t *val);
 409  416  int parse_call_math_rl(struct expression *call, const char *math, struct range_list **rl);
 410  417  const char *get_allocation_math(struct expression *expr);
↓ open down ↓ 421 lines elided ↑ open up ↑
 832  839          COMPARE_LIMIT   = 1028,
 833  840          PARAM_COMPARE   = 1029,
 834  841          CONSTRAINT      = 1031,
 835  842          PASSES_TYPE     = 1032,
 836  843          CONSTRAINT_REQUIRED = 1033,
 837  844          BIT_INFO        = 1034,
 838  845          NOSPEC          = 1035,
 839  846          NOSPEC_WB       = 1036,
 840  847          STMT_CNT        = 1037,
 841  848          TERMINATED      = 1038,
      849 +        FRESH_ALLOC     = 1044,
 842  850  
 843  851          /* put random temporary stuff in the 7000-7999 range for testing */
 844  852          USER_DATA       = 8017,
 845  853          USER_DATA_SET   = 9017,
 846  854          NO_OVERFLOW     = 8018,
 847  855          NO_OVERFLOW_SIMPLE = 8019,
 848  856          LOCKED          = 8020,
 849  857          UNLOCKED        = 8021,
 850  858          HALF_LOCKED     = 9022,
 851  859          LOCK_RESTORED   = 9023,
↓ open down ↓ 390 lines elided ↑ open up ↑
1242 1250  struct constraint_list *get_constraints(struct expression *expr);
1243 1251  char *unmet_constraint(struct expression *data, struct expression *offset);
1244 1252  char *get_required_constraint(const char *data_str);
1245 1253  
1246 1254  /* smatch_container_of.c */
1247 1255  int get_param_from_container_of(struct expression *expr);
1248 1256  int get_offset_from_container_of(struct expression *expr);
1249 1257  char *get_container_name(struct expression *container, struct expression *expr);
1250 1258  
1251 1259  /* smatch_mtag.c */
     1260 +mtag_t str_to_mtag(const char *str);
1252 1261  int get_string_mtag(struct expression *expr, mtag_t *tag);
1253 1262  int get_toplevel_mtag(struct symbol *sym, mtag_t *tag);
1254 1263  int create_mtag_alias(mtag_t tag, struct expression *expr, mtag_t *new);
1255 1264  int expr_to_mtag_offset(struct expression *expr, mtag_t *tag, int *offset);
1256 1265  void update_mtag_data(struct expression *expr, struct smatch_state *state);
1257 1266  int get_mtag_sval(struct expression *expr, sval_t *sval);
1258 1267  
1259 1268  /* Trinity fuzzer stuff */
1260 1269  const char *get_syscall_arg_type(struct symbol *sym);
1261 1270  
↓ open down ↓ 9 lines elided ↑ open up ↑
1271 1280  /* check_is_nospec.c */
1272 1281  bool is_nospec(struct expression *expr);
1273 1282  long get_stmt_cnt(void);
1274 1283  
1275 1284  /* smatch_nul_terminator.c */
1276 1285  bool is_nul_terminated_var_sym(const char *name, struct symbol *sym);
1277 1286  bool is_nul_terminated(struct expression *expr);
1278 1287  /* check_kernel.c  */
1279 1288  bool is_ignored_kernel_data(const char *name);
1280 1289  
     1290 +bool is_fresh_alloc_var_sym(const char *var, struct symbol *sym);
     1291 +bool is_fresh_alloc(struct expression *expr);
1281 1292  static inline bool type_is_ptr(struct symbol *type)
1282 1293  {
1283 1294          return type &&
1284 1295                 (type->type == SYM_PTR ||
1285 1296                  type->type == SYM_ARRAY ||
1286 1297                  type->type == SYM_FN);
1287 1298  }
1288 1299  
1289 1300  static inline bool type_is_fp(struct symbol *type)
1290 1301  {
↓ open down ↓ 119 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX