extra: handle integer overflows better for "int_foo += 4UL;"
commitc21028b9ee9856ed9132f628b3cc58e4b9513be5
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 11 May 2017 09:07:38 +0000 (11 12:07 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 11 May 2017 09:07:38 +0000 (11 12:07 +0300)
tree76658ad511e0912fadbb6b441a73e84d1f943c25
parent381b1d72b3c940023e62bd3a87b941f1cda33ddc
extra: handle integer overflows better for "int_foo += 4UL;"

Say you are adding an unsigned long to an integer on a 64 bit machine, then
it was checking if adding "(unsigned long)s64max + 4UL" can overflow.  It
can't so we would do the addition which gives a negative integer.  So then
it would say we now know that int_foo is s64min-(-2147483645).  What we
want it to say is that s32max + 4 can overflow so the value is
s32min-s32max still.

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