Skip to content

Commit 01a226b

Browse files
committed
C++: Rename multipliesBy->effectivelyMultipliesBy
From code review of #4098.
1 parent b65f822 commit 01a226b

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

cpp/ql/src/semmle/code/cpp/rangeanalysis/SimpleRangeAnalysis.qll

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ private class UnsignedMulExpr extends MulExpr {
190190
* Holds if `expr` is effectively a multiplication of `operand` with the
191191
* positive constant `positive`.
192192
*/
193-
private predicate multipliesByPositive(Expr expr, Expr operand, float positive) {
193+
private predicate effectivelyMultipliesByPositive(Expr expr, Expr operand, float positive) {
194194
operand = expr.(MulByConstantExpr).getOperand() and
195195
positive = expr.(MulByConstantExpr).getConstant() and
196196
positive >= 0.0 // includes positive zero
@@ -209,7 +209,7 @@ private predicate multipliesByPositive(Expr expr, Expr operand, float positive)
209209
* Holds if `expr` is effectively a multiplication of `operand` with the
210210
* negative constant `negative`.
211211
*/
212-
private predicate multipliesByNegative(Expr expr, Expr operand, float negative) {
212+
private predicate effectivelyMultipliesByNegative(Expr expr, Expr operand, float negative) {
213213
operand = expr.(MulByConstantExpr).getOperand() and
214214
negative = expr.(MulByConstantExpr).getConstant() and
215215
negative < 0.0 // includes negative zero
@@ -251,9 +251,9 @@ private predicate analyzableExpr(Expr e) {
251251
(
252252
exists(getValue(e).toFloat())
253253
or
254-
multipliesByPositive(e, _, _)
254+
effectivelyMultipliesByPositive(e, _, _)
255255
or
256-
multipliesByNegative(e, _, _)
256+
effectivelyMultipliesByNegative(e, _, _)
257257
or
258258
e instanceof MinExpr
259259
or
@@ -359,12 +359,12 @@ private predicate defDependsOnDef(
359359
*/
360360
private predicate exprDependsOnDef(Expr e, RangeSsaDefinition srcDef, StackVariable srcVar) {
361361
exists(Expr operand |
362-
multipliesByNegative(e, operand, _) and
362+
effectivelyMultipliesByNegative(e, operand, _) and
363363
exprDependsOnDef(operand, srcDef, srcVar)
364364
)
365365
or
366366
exists(Expr operand |
367-
multipliesByPositive(e, operand, _) and
367+
effectivelyMultipliesByPositive(e, operand, _) and
368368
exprDependsOnDef(operand, srcDef, srcVar)
369369
)
370370
or
@@ -673,13 +673,13 @@ deprecated predicate positive_overflow(Expr expr) { exprMightOverflowPositively(
673673
/** Only to be called by `getTruncatedLowerBounds`. */
674674
private float getLowerBoundsImpl(Expr expr) {
675675
exists(Expr operand, float operandLow, float positive |
676-
multipliesByPositive(expr, operand, positive) and
676+
effectivelyMultipliesByPositive(expr, operand, positive) and
677677
operandLow = getFullyConvertedLowerBounds(operand) and
678678
result = positive * operandLow
679679
)
680680
or
681681
exists(Expr operand, float operandHigh, float negative |
682-
multipliesByNegative(expr, operand, negative) and
682+
effectivelyMultipliesByNegative(expr, operand, negative) and
683683
operandHigh = getFullyConvertedUpperBounds(operand) and
684684
result = negative * operandHigh
685685
)
@@ -867,13 +867,13 @@ private float getLowerBoundsImpl(Expr expr) {
867867
/** Only to be called by `getTruncatedUpperBounds`. */
868868
private float getUpperBoundsImpl(Expr expr) {
869869
exists(Expr operand, float operandHigh, float positive |
870-
multipliesByPositive(expr, operand, positive) and
870+
effectivelyMultipliesByPositive(expr, operand, positive) and
871871
operandHigh = getFullyConvertedUpperBounds(operand) and
872872
result = positive * operandHigh
873873
)
874874
or
875875
exists(Expr operand, float operandLow, float negative |
876-
multipliesByNegative(expr, operand, negative) and
876+
effectivelyMultipliesByNegative(expr, operand, negative) and
877877
operandLow = getFullyConvertedLowerBounds(operand) and
878878
result = negative * operandLow
879879
)

0 commit comments

Comments
 (0)