Skip to content

Commit 9ebcaf8

Browse files
committed
Java: Fix some join-orders.
1 parent 6208071 commit 9ebcaf8

File tree

12 files changed

+14
-0
lines changed

12 files changed

+14
-0
lines changed

java/ql/lib/semmle/code/java/ControlFlowGraph.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ private module ControlFlowGraphImpl {
400400
/**
401401
* Gets a statement that always throws an exception or calls `exit`.
402402
*/
403+
pragma[assume_small_delta]
403404
private Stmt nonReturningStmt() {
404405
result instanceof ThrowStmt
405406
or
@@ -421,6 +422,7 @@ private module ControlFlowGraphImpl {
421422
/**
422423
* Gets an expression that always throws an exception or calls `exit`.
423424
*/
425+
pragma[assume_small_delta]
424426
private Expr nonReturningExpr() {
425427
result = nonReturningMethodAccess()
426428
or

java/ql/lib/semmle/code/java/Expr.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,6 +2026,7 @@ class TypeAccess extends Expr, Annotatable, @typeaccess {
20262026
override CompilationUnit getCompilationUnit() { result = Expr.super.getCompilationUnit() }
20272027

20282028
/** Gets a printable representation of this expression. */
2029+
pragma[assume_small_delta]
20292030
override string toString() {
20302031
result = this.getQualifier().toString() + "." + this.getType().toString()
20312032
or

java/ql/lib/semmle/code/java/Member.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,7 @@ class FieldDeclaration extends ExprParent, @fielddecl, Annotatable {
660660
/** Gets the number of fields declared in this declaration. */
661661
int getNumField() { result = max(int idx | fieldDeclaredIn(_, this, idx) | idx) + 1 }
662662

663+
pragma[assume_small_delta]
663664
override string toString() {
664665
if this.getNumField() = 1
665666
then result = this.getTypeAccess() + " " + this.getField(0) + ";"

java/ql/lib/semmle/code/java/Type.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ private predicate hasSubtypeStar1(RefType t, RefType sub) {
304304
/**
305305
* Holds if `hasSubtype*(t, sub)`, but manual-magic'ed with `getAWildcardLowerBound(sub)`.
306306
*/
307+
pragma[assume_small_delta]
307308
pragma[nomagic]
308309
private predicate hasSubtypeStar2(RefType t, RefType sub) {
309310
sub = t and getAWildcardLowerBound(sub)

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ EqualityTest varEqualityTestExpr(SsaVariable v1, SsaVariable v2, boolean isEqual
4242
}
4343

4444
/** Gets an expression that is provably not `null`. */
45+
pragma[assume_small_delta]
4546
Expr clearlyNotNullExpr(Expr reason) {
4647
result instanceof ClassInstanceExpr and reason = result
4748
or
@@ -236,6 +237,7 @@ Expr directNullGuard(SsaVariable v, boolean branch, boolean isnull) {
236237
* If `result` evaluates to `branch`, then `v` is guaranteed to be null if `isnull`
237238
* is true, and non-null if `isnull` is false.
238239
*/
240+
pragma[assume_small_delta]
239241
Guard nullGuard(SsaVariable v, boolean branch, boolean isnull) {
240242
result = directNullGuard(v, branch, isnull) or
241243
exists(boolean branch0 | implies_v3(result, branch, nullGuard(v, branch0, isnull), branch0))

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class SsaSourceVariable extends TSsaSourceVariable {
6161
* accessed from nested callables are therefore associated with several
6262
* `SsaSourceVariable`s.
6363
*/
64+
pragma[assume_small_delta]
6465
cached
6566
VarAccess getAnAccess() {
6667
exists(LocalScopeVariable v, Callable c |

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ private module ForAll<RankedEdge Edge, TypePropagation T> {
313313
* Holds if `t` is a candidate bound for `n` that is also valid for data coming
314314
* through the edges into `n` ranked from `1` to `r`.
315315
*/
316+
pragma[assume_small_delta]
316317
private predicate flowJoin(int r, TypeFlowNode n, T::Typ t) {
317318
(
318319
r = 1 and candJoinType(n, t)

java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,7 @@ private MethodAccess callReturningSameType(Expr ref) {
620620
result.getMethod().getReturnType() = ref.getType()
621621
}
622622

623+
pragma[assume_small_delta]
623624
private SrcRefType entrypointType() {
624625
exists(RemoteFlowSource s, RefType t |
625626
s instanceof DataFlow::ExplicitParameterNode and

java/ql/lib/semmle/code/java/dispatch/DispatchFlow.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ private Callable dispatchCand(Call c) {
2929
/**
3030
* Holds if `t` and all its enclosing types are public.
3131
*/
32+
pragma[assume_small_delta]
3233
private predicate veryPublic(RefType t) {
3334
t.isPublic() and
3435
(

java/ql/lib/semmle/code/java/dispatch/ObjFlow.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ private predicate relevantNodeBack(ObjNode n) {
206206
exists(ObjNode mid | objStep(n, mid) and relevantNodeBack(mid))
207207
}
208208

209+
pragma[assume_small_delta]
209210
private predicate relevantNode(ObjNode n) {
210211
source(_, n) and relevantNodeBack(n)
211212
or

0 commit comments

Comments
 (0)