comparison: handle unmatched comparisons to " orig" states
commitb69706fe0155f7535d2abdf8ef118daca5daa993
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 14 Jun 2013 06:48:40 +0000 (14 09:48 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Fri, 14 Jun 2013 06:48:40 +0000 (14 09:48 +0300)
tree3316b28795d384691d5368dfe548fd6751930d3a
parent9955e58069a56d6e7f99a953a48748cca36b4b6e
comparison: handle unmatched comparisons to " orig" states

The problem here is this:

int returns_less(int x)
{
        int y;

        if (x < 10)
                y = x;
        else
                y = 10;

        return y;
}

On the true branch then we know that "y == x orig".  On the false side,
we have an unmatched state.

For normal variables we take the implied range_list for both sides and
get the comparison from that.  For the " orig" state we can use the work
in smatch_limit.c and call get_orig_estate() using the symbol pointer.

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