user_data: move to the return_states API
[smatch.git] / validation / sm_loops4.c
blob308a8592bbc3778287987930cbc41df10b189f05
1 #include "check_debug.h"
3 char *some_func(void);
5 int x,y;
6 int i;
7 void func(void)
9 char *p;
10 char *p2;
12 if (x > 0)
13 p = some_func();
14 for (i = 0; i < x; i++)
15 *p = 'x';
16 *p = 'x';
17 if (y > 0)
18 p2 = some_func();
19 i = 0;
20 if (i < y)
21 *p2 = 'x';
24 * check-name: smatch loops #4
25 * check-command: smatch -I.. sm_loops4.c
27 * check-output-start
28 sm_loops4.c:16 func() error: potentially derefencing uninitialized 'p'.
29 * check-output-end