extra: handle MOD conditions like "if (a % 4) {" better
We're basically dorking around the minimum and maximum limits here. If
the start range is not known then we give up. In other words:
if (i == 0 || !(i % 4)) {
is handled differently from the same condition:
if (!(i % 4) || i == 0) {
Because the starting minimum condition is 1 in the first example and
0 in the second. That's fine, because this patch is better than doing
nothing and there is some kind of limit to the smatch_extra approach
to tracking values because you can only express so many values.
Smatch is about being practical more than being 100% perfect. So many
things are handled as special cases. Doing "foo % 4" is way more common
than doing "foo % 5" and I plan to handle that later by tracking set
and cleared bits better. Another idea would be to track all the true
conditions at any given time so you could say "if idx is 100 then were
out of bounds." then you could verify that all the conditions were
still possibly true. The point is that this isn't perfect but maybe
there will be ways later to get the other information that we want.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>