repo.or.cz
/
smatch.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
type: allow the parameter to be null for type_unsigned()
[smatch.git]
/
validation
/
sm_implied2.c
blob
4aac2eb78b704ac9e3f8b4bf40a7a522665284c5
1
struct
ture
{
2
int
a
;
3
};
4
5
struct
ture
*
a
;
6
struct
ture
*
b
;
7
struct
ture
*
c
;
8
9
void
func
(
void
)
10
{
11
struct
ture
*
aa
, *
ab
;
12
13
b
=
0
;
14
if
(
a
) {
15
aa
=
returns_nonnull
();
16
ab
=
returns_nonnull
();
17
}
else
{
18
b
= -
1
;
19
}
20
if
(!(
b
)) {
21
if
(
c
) {
22
aa
= (
void
*)
0
;
23
ab
= (
void
*)
0
;
24
b
= -
1
;
25
}
26
}
27
if
(!
c
)
28
aa
->
a
=
1
;
29
if
(
b
)
30
return
;
31
ab
->
a
=
1
;
32
return
;
33
}
34
/*
35
* check-name: Smatch implied #2
36
* check-command: smatch sm_implied2.c
37
*
38
* check-output-start
39
sm_implied2.c +28 func(19) error: potentially derefencing uninitialized 'aa'.
40
* check-output-end
41
*/