Index: lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp =================================================================== --- lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp +++ lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp @@ -98,10 +98,6 @@ nonloc::SymbolVal(SIE->getLHS()), svalBuilder.makeIntVal(extent.getValue() / constant), svalBuilder); - case BO_Add: - return getSimplifiedOffsets( - nonloc::SymbolVal(SIE->getLHS()), - svalBuilder.makeIntVal(extent.getValue() - constant), svalBuilder); default: break; } Index: test/Analysis/out-of-bounds.c =================================================================== --- test/Analysis/out-of-bounds.c +++ test/Analysis/out-of-bounds.c @@ -136,6 +136,14 @@ buf[x] = 1; // expected-warning{{Out of bound memory access}} } +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 +} + void test4(int x) { int buf[100]; if (x > 99)