blob: e496425eb91afeb78d9515a3ee164d7bbb0a88bf [file] [log] [blame]
Daniel Dunbar34fc92f2009-01-20 23:17:32 +00001// RUN: clang -analyze -checker-simple -analyzer-store-region -verify %s
Zhongxing Xubf900752008-11-24 02:19:49 +00002
3char f1() {
4 char* s = "abcd";
Ted Kremeneke54b87f42009-01-22 20:36:33 +00005 char c = s[4]; // no-warning
6 return s[5] + c; // expected-warning{{Load or store into an out-of-bound memory position.}}
Zhongxing Xubf900752008-11-24 02:19:49 +00007}