aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/outofbound.c
blob: d1a07abf527f99dfbc3bb42765c17e9e8ed2c7fe (plain)
1
2
3
4
5
6
7
// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-store=region -verify %s

char f1() {
  char* s = "abcd";
  char c = s[4]; // no-warning
  return s[5] + c; // expected-warning{{Access out-of-bound array element (buffer overflow)}}
}