blob: ca23437f92a3091bb7ebe5f3186179c6ce48515c [file] [log] [blame]
Zhongxing Xu5f097322009-03-03 00:28:42 +00001// RUN: clang -analyze -checker-simple -analyzer-store=region -verify %s
2
3void f1() {
4 int a[10];
5 int *p = a;
6 ++p;
7}
Zhongxing Xu3ae9f342009-03-11 07:43:49 +00008
9char* foo();
10
11void f2() {
12 char *p = foo();
13 ++p;
14}
Zhongxing Xu768b9d62009-03-11 09:15:38 +000015
16char* memchr();
17static int
18domain_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}