aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/outofbound.c
blob: e496425eb91afeb78d9515a3ee164d7bbb0a88bf (plain)
1
2
3
4
5
6
7
// RUN: clang -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.}}
}