Zhongxing Xu | 5f09732 | 2009-03-03 00:28:42 +0000 | [diff] [blame] | 1 | // RUN: clang -analyze -checker-simple -analyzer-store=region -verify %s |
| 2 | |
| 3 | void f1() { |
| 4 | int a[10]; |
| 5 | int *p = a; |
| 6 | ++p; |
| 7 | } |
Zhongxing Xu | 3ae9f34 | 2009-03-11 07:43:49 +0000 | [diff] [blame] | 8 | |
| 9 | char* foo(); |
| 10 | |
| 11 | void f2() { |
| 12 | char *p = foo(); |
| 13 | ++p; |
| 14 | } |
Zhongxing Xu | 768b9d6 | 2009-03-11 09:15:38 +0000 | [diff] [blame^] | 15 | |
| 16 | char* memchr(); |
| 17 | static int |
| 18 | domain_port (const char *domain_b, const char *domain_e, |
| 19 | const char **domain_e_ptr) |
| 20 | { |
| 21 | int port = 0; |
| 22 | |
| 23 | const char *p; |
| 24 | const char *colon = memchr (domain_b, ':', domain_e - domain_b); |
| 25 | |
| 26 | for (p = colon + 1; p < domain_e ; p++) |
| 27 | port = 10 * port + (*p - '0'); |
| 28 | return port; |
| 29 | } |