@@ -132,6 +132,8 @@ class SubAnalyzableExpr extends AnalyzableExpr, SubExpr {
132132}
133133
134134class VarAnalyzableExpr extends AnalyzableExpr , VariableAccess {
135+ VarAnalyzableExpr ( ) { not exists ( this .getQualifier ( ) ) }
136+
135137 override float maxValue ( ) {
136138 exists ( SsaDefinition def , Variable v |
137139 def .getAUse ( v ) = this and
@@ -140,7 +142,7 @@ class VarAnalyzableExpr extends AnalyzableExpr, VariableAccess {
140142 // variable the largest possible value it can hold
141143 if exists ( def .getDefiningValue ( v ) )
142144 then result = def .getDefiningValue ( v ) .( AnalyzableExpr ) .maxValue ( )
143- else result = exprMaxVal ( this )
145+ else result = upperBound ( this )
144146 )
145147 }
146148
@@ -149,7 +151,7 @@ class VarAnalyzableExpr extends AnalyzableExpr, VariableAccess {
149151 def .getAUse ( v ) = this and
150152 if exists ( def .getDefiningValue ( v ) )
151153 then result = def .getDefiningValue ( v ) .( AnalyzableExpr ) .minValue ( )
152- else result = exprMinVal ( this )
154+ else result = lowerBound ( this )
153155 )
154156 }
155157}
@@ -206,9 +208,9 @@ where
206208 ) and
207209 e .( Literal ) .getType ( ) .getSize ( ) = t2 .getSize ( )
208210 ) and
209- // only report if cannot prove that the result of the
211+ // only report if we cannot prove that the result of the
210212 // multiplication will be less (resp. greater) than the
211- // maximum (resp. minimum) number we can store .
213+ // maximum (resp. minimum) number we can compute .
212214 overflows ( me , t1 )
213215select me ,
214216 "Multiplication result may overflow '" + me .getType ( ) .toString ( ) + "' before it is converted to '"
0 commit comments