extra: small fix for when the database is disabled but we have inline info
[smatch.git] / validation / sm_implied2.c
blob8250f53cc35882ddf4fce7c705f7127ef6e2788d
1 struct ture {
2 int a;
3 };
5 struct ture *a;
6 struct ture *b;
7 struct ture *c;
9 void func (void)
11 struct ture *aa, *ab;
13 b = 0;
14 if (a) {
15 aa = returns_nonnull();
16 ab = returns_nonnull();
17 } else {
18 b = -1;
20 if (!(b)) {
21 if (c) {
22 aa = (void *)0;
23 ab = (void *)0;
24 b = -1;
27 if (!c)
28 aa->a = 1;
29 if (b)
30 return;
31 ab->a = 1;
32 return;
35 * check-name: Smatch implied #2
36 * check-command: smatch sm_implied2.c
38 * check-output-start
39 sm_implied2.c:28 func() error: potentially dereferencing uninitialized 'aa'.
40 * check-output-end