Print this page
11506 smatch resync

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/smatch_real_absolute.c
          +++ new/usr/src/tools/smatch/src/smatch_real_absolute.c
↓ open down ↓ 95 lines elided ↑ open up ↑
  96   96          if (is_fake_call(expr->right))
  97   97                  return;
  98   98          if (in_iterator_pre_statement())
  99   99                  return;
 100  100  
 101  101          get_real_absolute_rl(expr->right, &rl);
 102  102  
 103  103          type = get_type(expr->left);
 104  104          if (!type)
 105  105                  return;
      106 +        if (type->type != SYM_PTR && type->type != SYM_BASETYPE &&
      107 +            type->type != SYM_ENUM)
      108 +                return;
 106  109  
 107  110          rl = cast_rl(type, rl);
 108  111          if (is_whole_rl(rl) && !get_state_expr(my_id, expr->left))
 109  112                  return;
 110  113          /* These are handled by smatch_extra.c */
 111  114          if (rl_to_sval(rl, &sval) && !get_state_expr(my_id, expr->left))
 112  115                  return;
 113  116  
 114  117          set_state_expr(my_id, expr->left, alloc_estate_rl(clone_rl(rl)));
 115  118  }
↓ open down ↓ 5 lines elided ↑ open up ↑
 121  124  
 122  125  struct smatch_state *get_real_absolute_state_var_sym(const char *name, struct symbol *sym)
 123  126  {
 124  127          return get_state(my_id, name, sym);
 125  128  }
 126  129  
 127  130  void register_real_absolute(int id)
 128  131  {
 129  132          my_id = id;
 130  133  
      134 +        set_dynamic_states(my_id);
 131  135          add_pre_merge_hook(my_id, &pre_merge_hook);
 132  136          add_unmatched_state_hook(my_id, &empty_state);
 133  137          add_merge_hook(my_id, &merge_estates);
 134  138          add_modification_hook(my_id, &reset);
 135  139  
 136  140          add_hook(&match_assign, ASSIGNMENT_HOOK);
 137  141  }
 138  142  
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX