freebsd-skq/test/Analysis/outofbound.c
2009-06-02 17:58:47 +00:00

8 lines
236 B
C

// RUN: clang-cc -analyze -checker-simple -analyzer-store=region -verify %s
char f1() {
char* s = "abcd";
char c = s[4]; // no-warning
return s[5] + c; // expected-warning{{Load or store into an out-of-bound memory position.}}
}