Print this page
11506 smatch resync

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/check_shift_to_zero.c
          +++ new/usr/src/tools/smatch/src/check_shift_to_zero.c
↓ open down ↓ 27 lines elided ↑ open up ↑
  28   28                  return;
  29   29  
  30   30          if (!get_implied_value(expr->right, &bits))
  31   31                  return;
  32   32  
  33   33          type = get_type(expr->left);
  34   34          if (!type)
  35   35                  return;
  36   36          if (type_bits(type) == -1 || type_bits(type) > bits.value)
  37   37                  return;
       38 +        if (is_ignored_expr(my_id, expr))
       39 +                return;
  38   40          sm_warning("right shifting more than type allows %d vs %lld", type_bits(type), bits.value);
  39   41  }
  40   42  
  41   43  static void match_binop2(struct expression *expr)
  42   44  {
  43   45          struct expression *left;
  44   46          struct expression *tmp;
  45   47          sval_t mask, shift;
  46   48  
  47   49          if (expr->op != SPECIAL_RIGHTSHIFT)
↓ open down ↓ 48 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX