function_hooks: fix the previous range hooks fix again
commit987a0348b45ae8d82cf0809871e48017f1c26a59
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 15 Jun 2016 18:46:50 +0000 (15 21:46 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Wed, 15 Jun 2016 18:46:50 +0000 (15 21:46 +0300)
tree12d5b75c88fec07d808acdbe3ac9758f9bf591fe
parentb505e8756927b4bce60c4efa564a3e57797f2504
function_hooks: fix the previous range hooks fix again

So the issue is that in range hooks we say: (-4095)-(-1) means the lock
is unlocked.  Then in the database, depending on the situation it could
say that "oh, that function returns s32min-s32max", or it could say, "That
function returns -4".

The code handles s32min-s32max correctly and says, "oh, that's worthless,
lets fall back to the old code."  The problem is that it falls back to the
old code for -4 as well.

Generally, we can assume that the range hooks are either more general or
wrong.  For example, the range hooks say "negatives are error" but the DB
will say "-4 is error."  If the range hooks say "-4 is an error" but the
DB says "(-10)-(-3) are error codes" then it means the range hooks are
wrong.

So what we need to check is that the DB is inside the range with no parts
of it on the outside.

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