flow: change how "for (i = 0; ; i++) { ..." is handled
commit17b73d8c561b4ccd44cafb734e41a5bef59f9d5f
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 26 Apr 2012 12:27:44 +0000 (26 15:27 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Thu, 26 Apr 2012 12:27:44 +0000 (26 15:27 +0300)
tree6eb2c65eef4f0a9cec805ef29b3128b0a378ac10
parentdad9097fc1dc5e62fe9207b17341dd248c869815
flow: change how "for (i = 0; ; i++) { ..." is handled

In the old code the i++ was ignored.  But now we take it even though we
ignore all the other state changes.  Now the following code:

j = 0;
        for (i = 0; ; i++) {
                if (x == 3)
                        break;
                j++;
        }

        __smatch_implied(i);
        __smatch_implied(j);

Gives:
test.c:20 func() implied: i = '0-max'
test.c:21 func() implied: j = '0'

Which is still not right, but it's improved.  I really need to look at how
--two-passes should work again and fix how loops are handled.

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