Actions
Bug #12241
opensmatch: misreported 'mask and shift to zero'
Start date:
Due date:
% Done:
90%
Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
Description
match_binop2() is testing expressions in form: (mask & value) >> shift
and fails with variable >> shift, because we get incoming expression set to: (mask & ) >> shift and the mask value may not be correct.
In specific error case we do have 64-bit lhs for >> operator, and we do shift 32 bits; the mask value is set to 32-bit unsigned max and shifting it by 32 bits, we do end up with match_binop2() reporting the warning.
example warning case:
/code/illumos-gate/usr/src/tools/proto/root_sparc-nd/opt/onbld/bin/sparc/smatch: /code/illumos-gate/usr/src/common/bignum/bignumimpl.c:1410 big_mul_add_vec() warn: mask and shift to zero
Actions