sval: make cast_rl() preserve things better across signed casts
commit39d019795c8cc15b5cbd6b79a8c1f7f5ee13dcff
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 19 Nov 2012 18:56:47 +0000 (19 21:56 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Mon, 19 Nov 2012 18:56:47 +0000 (19 21:56 +0300)
tree0e84d3d6a38f900a354115901a800c5ca446d4fb
parent04a122ec5645d2e3a41ecd653d1f3cecc9deb230
sval: make cast_rl() preserve things better across signed casts

In the old code if you had the condition:
int x;

if (x < (unsigned int)99) { ...

Then it would say that the true state is x == 0-5 and the false state is:
s32min-s32max.  That's obviously not correct.  What we want is the false
state to say x=s32min-(-1),99-s32max.

This patch does that.

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