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) {
5454 // it is hard to tell when a struct or array has been initialized, so we
5555 // ignore them
5656 not isAggregateType ( lv .getUnderlyingType ( ) ) and
57+ not lv .isStatic ( ) and // static variables are initialized to zero or null by default
5758 not lv .getType ( ) .hasName ( "va_list" ) and
5859 va = lv .getAnAccess ( ) and
5960 noDefPath ( lv , va ) and
@@ -70,7 +71,8 @@ predicate uninitialisedGlobal(GlobalVariable gv) {
7071 va = gv .getAnAccess ( ) and
7172 va .isRValue ( ) and
7273 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
7476 )
7577}
7678
You can’t perform that action at this time.
0 commit comments