File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ predicate undefinedLocalUse(VariableAccess va) {
54
54
// it is hard to tell when a struct or array has been initialized, so we
55
55
// ignore them
56
56
not isAggregateType ( lv .getUnderlyingType ( ) ) and
57
+ not lv .isStatic ( ) and // static variables are initialized to zero or null by default
57
58
not lv .getType ( ) .hasName ( "va_list" ) and
58
59
va = lv .getAnAccess ( ) and
59
60
noDefPath ( lv , va ) and
@@ -70,7 +71,8 @@ predicate uninitialisedGlobal(GlobalVariable gv) {
70
71
va = gv .getAnAccess ( ) and
71
72
va .isRValue ( ) and
72
73
not gv .hasInitializer ( ) and
73
- not gv .hasSpecifier ( "extern" )
74
+ not gv .hasSpecifier ( "extern" ) and
75
+ not gv .isStatic ( ) // static variables are initialized to zero or null by default
74
76
)
75
77
}
76
78
You can’t perform that action at this time.
0 commit comments