Print this page
new smatch

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/check_free.c
          +++ new/usr/src/tools/smatch/src/check_free.c
↓ open down ↓ 28 lines elided ↑ open up ↑
  29   29  
  30   30  STATE(freed);
  31   31  STATE(ok);
  32   32  
  33   33  static void ok_to_use(struct sm_state *sm, struct expression *mod_expr)
  34   34  {
  35   35          if (sm->state != &ok)
  36   36                  set_state(my_id, sm->name, sm->sym, &ok);
  37   37  }
  38   38  
  39      -static void pre_merge_hook(struct sm_state *sm)
       39 +static void pre_merge_hook(struct sm_state *cur, struct sm_state *other)
  40   40  {
  41   41          if (is_impossible_path())
  42      -                set_state(my_id, sm->name, sm->sym, &ok);
       42 +                set_state(my_id, cur->name, cur->sym, &ok);
  43   43  }
  44   44  
  45   45  static int is_freed(struct expression *expr)
  46   46  {
  47   47          struct sm_state *sm;
  48   48  
  49   49          sm = get_sm_state_expr(my_id, expr);
  50   50          if (sm && slist_has_state(sm->possible, &freed))
  51   51                  return 1;
  52   52          return 0;
↓ open down ↓ 250 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX