sval: ranges: set correct max in cast_rl()
commit0eebe98ec68d9676c3f615eab656500155f77d91
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 15 Nov 2012 09:25:55 +0000 (15 12:25 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 15 Nov 2012 09:25:55 +0000 (15 12:25 +0300)
treee6f0de3ba11300daf3de0300d0ea48321984c091
parent100f783855ec43f3ad58eb3cd1e21e988f828fb7
sval: ranges: set correct max in cast_rl()

If the max value is higher than the type max then we set the casted max to
the type max.  Before if you assigned an unsigned int to a signed int, it
was casting u32max to (-1) and using that as the max instead of s32max.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch_ranges.c
validation/sm_casts3.c [new file with mode: 0644]