Skip to content

Commit 09891b0

Browse files
Remove changes to SimpleRangeAnalysisCustomizations.qll
1 parent c0e2020 commit 09891b0

File tree

1 file changed

+0
-39
lines changed

1 file changed

+0
-39
lines changed

cpp/common/src/codingstandards/cpp/SimpleRangeAnalysisCustomizations.qll

-39
Original file line numberDiff line numberDiff line change
@@ -14,45 +14,6 @@ import semmle.code.cpp.rangeanalysis.RangeAnalysisUtils
1414
import experimental.semmle.code.cpp.rangeanalysis.extensions.ConstantBitwiseAndExprRange
1515
private import experimental.semmle.code.cpp.models.interfaces.SimpleRangeAnalysisExpr
1616

17-
// Disabled, causing performance issues in grpc:
18-
/*
19-
private class DivByConstantExpr extends SimpleRangeAnalysisExpr, DivExpr {
20-
float quotient;
21-
22-
DivByConstantExpr() {
23-
quotient = evaluateConstantExpr(getRightOperand())
24-
}
25-
26-
override predicate dependsOnChild(Expr e) {
27-
e = getLeftOperand()
28-
}
29-
30-
override float getLowerBounds() {
31-
exists(float numerator |
32-
result = numerator / quotient and
33-
if (quotient > 0) then
34-
// x / y where and y is positive scales the UB/LB.
35-
numerator = getFullyConvertedLowerBounds(getLeftOperand())
36-
else
37-
// x / -y where and -y is negative will invert and scale the UB/LB.
38-
numerator = getFullyConvertedUpperBounds(getLeftOperand())
39-
)
40-
}
41-
42-
override float getUpperBounds() {
43-
exists(float numerator |
44-
result = numerator / quotient and
45-
if (quotient > 0) then
46-
// x / y where and y is positive scales the UB/LB.
47-
numerator = getFullyConvertedUpperBounds(getLeftOperand())
48-
else
49-
// x / -y where and -y is negative will invert and scale the UB/LB.
50-
numerator = getFullyConvertedLowerBounds(getLeftOperand())
51-
)
52-
}
53-
}
54-
*/
55-
5617
/**
5718
* A range analysis extension that support bitwise `|` and `|=` where at least one operand is a
5819
* non-negative constant.

0 commit comments

Comments
 (0)