Example code:
void test3_simplified_offset(int x, unsigned long long y) { int buf[100]; if (x < 0) x = 0; for (int i = y - x; i > 0 && i < 100; i++) buf[i] = 0; // no-warning }
Without this patch Clang will wrongly report this FP:
File out-of-bounds.c Line 144: Out of bound memory access (accessed memory precedes memory block)
There is some bug in the getSimplifiedOffsets() calculations. I removed the wrong calculations and this does not break any existing tests so either no tests were written in the first place or these calculations got redundant sometime. If somebody wants to readd the calculations that I remove.. I am not against that if some tests are added and it does not break my test.