Daniel Dunbar | 34fc92f | 2009-01-20 23:17:32 +0000 | [diff] [blame] | 1 | // RUN: clang -analyze -checker-simple -analyzer-store-region -verify %s |
Zhongxing Xu | bf90075 | 2008-11-24 02:19:49 +0000 | [diff] [blame] | 2 | |
3 | char f1() { | ||||
4 | char* s = "abcd"; | ||||
Ted Kremenek | e54b87f4 | 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 | bf90075 | 2008-11-24 02:19:49 +0000 | [diff] [blame] | 7 | } |