File tree 1 file changed +0
-39
lines changed
cpp/common/src/codingstandards/cpp
1 file changed +0
-39
lines changed Original file line number Diff line number Diff line change @@ -14,45 +14,6 @@ import semmle.code.cpp.rangeanalysis.RangeAnalysisUtils
14
14
import experimental.semmle.code.cpp.rangeanalysis.extensions.ConstantBitwiseAndExprRange
15
15
private import experimental.semmle.code.cpp.models.interfaces.SimpleRangeAnalysisExpr
16
16
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
-
56
17
/**
57
18
* A range analysis extension that support bitwise `|` and `|=` where at least one operand is a
58
19
* non-negative constant.
You can’t perform that action at this time.
0 commit comments