fix WARN_ON handling some more
[smatch.git] / validation / sm_implied6.c
blob8c5f90aa3e1672cb64de78edc50db0ad7b8ed724
1 struct foo {
2 int a;
3 };
5 struct foo *a;
6 struct foo *b;
7 struct foo *c;
8 struct foo *d;
9 int x, y, z;
11 void func (void)
13 a = 0;
14 b = 0;
15 c = 0;
16 d = 0;
18 if (x)
19 a = returns_nonnull();
20 else
21 b = returns_nonnull();
22 if (y)
23 a = returns_nonnull();
24 else
25 c = returns_nonnull();
26 __smatch_extra_values();
27 if (x || y) {
28 a->a = 1;
29 b->a = 2;
30 }else {
31 c->a = 3;
35 * check-name: Smatch implied #6
36 * check-command: smatch sm_implied6.c
38 * check-output-start
39 sm_implied6.c +29 func(18) error: potential null derefence 'b'.
40 * check-output-end