comparison: handle __smatch_compare(foo, bar - 1)
commit212a4fba20be97d2e6af3f19f3fcdd754469e4e2
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 16 Feb 2018 12:27:23 +0000 (16 15:27 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Fri, 16 Feb 2018 12:27:23 +0000 (16 15:27 +0300)
tree7bd392fc51eb8ead37da42f120155dac0668b931
parent9d937f559ff0ce54d2a370733211e2225e4eb55e
comparison:  handle __smatch_compare(foo, bar - 1)

It's pretty common to have a code like this:

for (i = 0; i < limit; i++) {
...
if (i == limit - 1)
last_item_stuff();
}

In other words, comparing with "limit - 1" is a very common special case
and I'm adding support for that.  This change is not directly useful by
itself.

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