ranges: don't allow so many inverted ranges
commit59f7b5a4086f6c3f3268055688c2b405a4ea2170
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 30 Jul 2015 10:37:22 +0000 (30 13:37 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 30 Jul 2015 10:37:22 +0000 (30 13:37 +0300)
tree6791e7dded203c929c3df1e0c7805f8ab8d488af
parent0ee2670447927b7498fd7b1756d4b35b322c8b98
ranges: don't allow so many inverted ranges

It turns out that we were getting a lot of ranges like 0-(-1).  Part of
the problem was the nested struct issue fixed in 0ee267044792 ('type:
improve get_member_type_from_key()').  But also when we add a range we
should do it with add_range_type().  I moved that function around to
avoid the forward declaration.

If that fails, and we still get and inverted type then just use the whole
range at that point.

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