extra: handle "if (foo & 0x1) {"
commitcb070d8b31d941adae4ee5fc9f926735d0f5f33a
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 21 Feb 2018 09:03:38 +0000 (21 12:03 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 21 Feb 2018 09:03:38 +0000 (21 12:03 +0300)
treec54dad08902a79f34d5d0b3770708c6c9e2d6460
parent210e54395e62dc4a596e002d54959fad1e1e8e4d
extra: handle "if (foo & 0x1) {"

The following code is a pretty common idiom:

if (!(offset & 0x1))
array[offset + 1] = foo;

Say array[] has an even number of elements and we know that offset is
less than array size.  That means the last element is an odd number so we
can test for it and know that we're within bounds.

Anyway, the point is that it's a common idiom and we can test for it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_extra.c