| Ted Kremenek | d1c53ff | 2009-06-26 00:05:51 +0000 | [diff] [blame^] | 1 | // RUN: clang-cc -analyze -checker-cfref -analyzer-store=region -verify %s |
| Zhongxing Xu | ff805e7 | 2008-11-24 02:19:49 +0000 | [diff] [blame] | 2 | |
| 3 | char f1() { | ||||
| 4 | char* s = "abcd"; | ||||
| Ted Kremenek | 0e58355 | 2009-01-22 20:36:33 +0000 | [diff] [blame] | 5 | char c = s[4]; // no-warning |
| 6 | return s[5] + c; // expected-warning{{Load or store into an out-of-bound memory position.}} | ||||
| Zhongxing Xu | ff805e7 | 2008-11-24 02:19:49 +0000 | [diff] [blame] | 7 | } |