@@ -111,25 +111,24 @@ float widenUpperBound(Type type, float ub) {
111111 * compilation units, which doesn't necessarily have a getValue() result from the extractor.
112112 */
113113private string getValue ( Expr e ) {
114- if exists ( e .getValue ( ) )
115- then result = e .getValue ( )
116- else
117- /*
118- * It should be safe to propagate the initialization value to a variable if:
119- * The type of v is const, and
120- * The type of v is not volatile, and
121- * Either:
122- * v is a local/global variable, or
123- * v is a static member variable
124- */
125-
126- exists ( VariableAccess access , StaticStorageDurationVariable v |
127- not v .getUnderlyingType ( ) .isVolatile ( ) and
128- v .getUnderlyingType ( ) .isConst ( ) and
129- e = access and
130- v = access .getTarget ( ) and
131- result = getValue ( v .getAnAssignedValue ( ) )
132- )
114+ result = e .getValue ( )
115+ or
116+ not exists ( e .getValue ( ) ) and
117+ /*
118+ * It should be safe to propagate the initialization value to a variable if:
119+ * The type of v is const, and
120+ * The type of v is not volatile, and
121+ * Either:
122+ * v is a local/global variable, or
123+ * v is a static member variable
124+ */
125+
126+ exists ( StaticStorageDurationVariable v |
127+ not v .getUnderlyingType ( ) .isVolatile ( ) and
128+ v .getUnderlyingType ( ) .isConst ( ) and
129+ v = e .( VariableAccess ) .getTarget ( ) and
130+ result = getValue ( v .getAnAssignedValue ( ) )
131+ )
133132}
134133
135134/**
0 commit comments