New function harmonize_states()
[smatch.git] / validation / sm_select.c
blobfc9f04fcbdfaea0d95825d34d3540c63bb41ff58
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) Dereferencing Undefined: 'a'
33 sm_select.c +18 func(7) Dereferencing Undefined: 'b'
34 sm_select.c +21 func(10) Dereferencing Undefined: 'c'
35 sm_select.c +23 func(12) Dereferencing Undefined: 'e'
36 * check-output-end