Print this page
11506 smatch resync
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/smatch/src/validation/sm_implied2.c
+++ new/usr/src/tools/smatch/src/validation/sm_implied2.c
1 1 struct ture {
2 2 int a;
3 3 };
4 4
5 5 struct ture *a;
6 6 struct ture *b;
7 7 struct ture *c;
8 8
9 9 void func (void)
10 10 {
11 11 struct ture *aa, *ab;
12 12
13 13 b = 0;
14 14 if (a) {
15 15 aa = returns_nonnull();
16 16 ab = returns_nonnull();
17 17 } else {
18 18 b = -1;
19 19 }
20 20 if (!(b)) {
21 21 if (c) {
22 22 aa = (void *)0;
23 23 ab = (void *)0;
24 24 b = -1;
25 25 }
26 26 }
27 27 if (!c)
28 28 aa->a = 1;
29 29 if (b)
↓ open down ↓ |
29 lines elided |
↑ open up ↑ |
30 30 return;
31 31 ab->a = 1;
32 32 return;
33 33 }
34 34 /*
35 35 * check-name: Smatch implied #2
36 36 * check-command: smatch --spammy sm_implied2.c
37 37 *
38 38 * check-output-start
39 39 sm_implied2.c:28 func() error: potentially dereferencing uninitialized 'aa'.
40 +sm_implied2.c:28 func() error: potentially dereferencing uninitialized 'aa'.
40 41 * check-output-end
41 42 */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX