ranges: fix casting of invalid range lists
commit9eee902efca33490ef2094857cf0fa6ebcc8e273
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 22 Feb 2013 09:14:30 +0000 (22 12:14 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Fri, 22 Feb 2013 09:14:30 +0000 (22 12:14 +0300)
treea0062c5c5d14dfde027dfd717fd1e7bdcabef261
parent304f019c8ec9106a3783b5c0dbed2269d705b946
ranges: fix casting of invalid range lists

I recently changed this to not allocate a new range list if the original
type is the type of the casted range list.

The problem is that sometimes we have bogus range lists where the type
is unsigned char but the range is 0-u32max.  This could be because there
is a bug in the smatch code.  I fixed one of those earlier today.  Or it
could be because it's hard/impossible sometimes to get the type right
when typeof() is used.

I've added a check to deal with those incorrect range lists which should
hide the problem.

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