introduce: get_dinfo()
[smatch.git] / validation / sm_select.c
blob89fb4a140468d7e0f8e71f71ff9ef15ad22d170d
1 struct foo {
2 int a;
3 };
5 struct foo *a;
6 struct foo *b;
8 struct foo *c;
9 struct foo *d;
10 struct foo *e;
11 void func (void)
13 if (a?b:0) {
14 a->a = 1;
15 b->a = 1;
17 a->a = 1;
18 b->a = 1;
19 d = returns_nonnull();
20 if (c?d:e) {
21 c->a = 1;
22 d->a = 1;
23 e->a = 1;
28 * check-name: Ternary Conditions
29 * check-command: smatch sm_select.c
31 * check-output-start
32 sm_select.c +17 func(6) error: dereferencing undefined: 'a'
33 sm_select.c +18 func(7) error: dereferencing undefined: 'b'
34 sm_select.c +21 func(10) error: dereferencing undefined: 'c'
35 sm_select.c +23 func(12) error: dereferencing undefined: 'e'
36 * check-output-end