Print this page
new smatch

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/check_testing_index_after_use.c
          +++ new/usr/src/tools/smatch/src/check_testing_index_after_use.c
↓ open down ↓ 50 lines elided ↑ open up ↑
  51   51          if (!array_size || array_size == 1)
  52   52                  return;
  53   53  
  54   54          offset = get_array_offset(expr);
  55   55          get_absolute_rl(offset, &rl);
  56   56          if (rl_max(rl).uvalue < array_size)
  57   57                  return;
  58   58          if (buf_comparison_index_ok(expr))
  59   59                  return;
  60   60  
  61      -        if (getting_address())
       61 +        if (getting_address(expr))
  62   62                  return;
  63   63          if (is_capped(offset))
  64   64                  return;
  65   65          set_state_expr(my_used_id, offset, alloc_state_num(array_size));
  66   66  }
  67   67  
  68   68  static void match_condition(struct expression *expr)
  69   69  {
  70   70          int left;
  71   71          sval_t sval;
↓ open down ↓ 44 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX