Skip to content

Commit 48291dd

Browse files
committed
Rangeanalysis: Remove superfluous ignoreZeroLowerBound.
1 parent 34b9791 commit 48291dd

File tree

4 files changed

+1
-29
lines changed

4 files changed

+1
-29
lines changed

cpp/ql/lib/semmle/code/cpp/rangeanalysis/new/internal/semantic/analysis/RangeAnalysisConstantSpecific.qll

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ module CppLangImplConstant implements LangSig<Sem, FloatDelta> {
1616
*/
1717
predicate ignoreExprBound(SemExpr e) { none() }
1818

19-
/**
20-
* Ignore any inferred zero lower bound on this expression.
21-
*
22-
* This predicate is to keep the results identical to the original Java implementation. It should be
23-
* removed once we have the new implementation matching the old results exactly.
24-
*/
25-
predicate ignoreZeroLowerBound(SemExpr e) { none() }
26-
2719
/**
2820
* Holds if `e >= bound` (if `upper = false`) or `e <= bound` (if `upper = true`).
2921
*/

cpp/ql/lib/semmle/code/cpp/rangeanalysis/new/internal/semantic/analysis/RangeAnalysisRelativeSpecific.qll

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,6 @@ module CppLangImplRelative implements LangSig<Sem, FloatDelta> {
4848
t instanceof SemFloatingPointType and lb = -(1.0 / 0.0) and ub = 1.0 / 0.0
4949
}
5050

51-
/**
52-
* Ignore any inferred zero lower bound on this expression.
53-
*
54-
* This predicate is to keep the results identical to the original Java implementation. It should be
55-
* removed once we have the new implementation matching the old results exactly.
56-
*/
57-
predicate ignoreZeroLowerBound(SemExpr e) { none() }
58-
5951
/**
6052
* Holds if `e >= bound` (if `upper = false`) or `e <= bound` (if `upper = true`).
6153
*/

java/ql/lib/semmle/code/java/dataflow/RangeAnalysis.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,6 @@ module JavaLangImpl implements LangSig<Sem, IntDelta> {
373373

374374
predicate ignoreExprBound(Sem::Expr e) { none() }
375375

376-
predicate ignoreZeroLowerBound(Sem::Expr e) { none() }
377-
378376
predicate additionalValueFlowStep(Sem::Expr dest, Sem::Expr src, int delta) { none() }
379377

380378
Sem::Type getAlternateType(Sem::Expr e) { none() }

shared/rangeanalysis/codeql/rangeanalysis/RangeAnalysis.qll

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -268,14 +268,6 @@ signature module LangSig<Semantic Sem, DeltaSig D> {
268268
*/
269269
predicate ignoreExprBound(Sem::Expr e);
270270

271-
/**
272-
* Ignore any inferred zero lower bound on this expression.
273-
*
274-
* This predicate is to keep the results identical to the original Java implementation. It should be
275-
* removed once we have the new implementation matching the old results exactly.
276-
*/
277-
predicate ignoreZeroLowerBound(Sem::Expr e);
278-
279271
/**
280272
* Holds if the value of `dest` is known to be `src + delta`.
281273
*/
@@ -1066,9 +1058,7 @@ module RangeStage<
10661058
or
10671059
upper = false and
10681060
b = D::fromInt(0) and
1069-
semPositive(e.(Sem::BitAndExpr).getAnOperand()) and
1070-
// REVIEW: We let the language opt out here to preserve original results.
1071-
not ignoreZeroLowerBound(e)
1061+
semPositive(e.(Sem::BitAndExpr).getAnOperand())
10721062
}
10731063

10741064
/**

0 commit comments

Comments
 (0)