smatch_data/kernel.unreachable.ignore: add BUG(), WARN_ON() and others
[smatch.git] / validation / sm_implied6.c
blobd4dce8b4ea990e1647a53d1e104b5be669a03f10
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 --spammy sm_implied6.c
38 * check-output-start
39 sm_implied6.c:29 func() error: potential NULL dereference 'b'.
40 * check-output-end