db: handle comparisons that we know are true better
commit9e4a96b32fcc83470ba583d6fa0c4e10cf985101
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 8 Jul 2016 11:40:38 +0000 (8 14:40 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Fri, 8 Jul 2016 11:40:38 +0000 (8 14:40 +0300)
tree4fcc087b4969990b0fa4fd0c11f066c603c9f23a
parent61be43e62637fc218983e66143da7238f55f133e
db: handle comparisons that we know are true better

Say you have a comparison:

return foo->aaa == foo->bbb;

Say we know that those are not equal (the same thing applies for equal
as well).  It means that in call_return_state_hooks() then
get_implied_value() returns true, so it's not treated as a boolean
return but as a vanilla return of zero.

The problem is that we have merged the != and == states together and the
possible and impossible paths.  We want to separate them out so that we
can record in the database that foo->aaa != foo->bbb.

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