absolute: track the absolute limits that variables can be
[smatch.git] / validation / sm_implied6.c
blob4b6a7a14f19ff3082543cb128fe9446f6df10737
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() error: potential NULL dereference 'b'.
40 * check-output-end