extra: assume indexes are in bounds
[smatch.git] / validation / sm_user_data3.c
blobf10ba53c4b5021929bd6af0f35b05a3158e3c9a5
1 #include "check_debug.h"
3 int copy_from_user(void *dest, void *src, int size){}
5 struct my_struct {
6 int x, y;
7 };
9 struct my_struct *returns_filter(struct my_struct *p)
11 return p;
14 struct my_struct *src, *a, *b;
15 void test(void)
17 copy_from_user(a, src, sizeof(*a));
18 b = returns_filter(a);
19 __smatch_state("check_user_data", "b->y");
20 b = returns_filter(src);
21 __smatch_state("check_user_data", "b->y");
22 b = returns_filter(a);
23 __smatch_state("check_user_data", "b->y");
27 * check-name: smatch user data #3
28 * check-command: smatch -p=kernel -I.. sm_user_data3.c
30 * check-output-start
31 sm_user_data3.c:19 test() 'b->y' = 'user_data_set'
32 sm_user_data3.c:21 test() 'b->y' = 'capped'
33 sm_user_data3.c:23 test() 'b->y' = 'user_data_set'
34 * check-output-end