Skip to content

Commit 331b8c0

Browse files
authored
Merge pull request github#10904 from aschackmull/java/joinorders
Java: Fix some join-orders.
2 parents 924f999 + 9ebcaf8 commit 331b8c0

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
@@ -682,6 +682,7 @@ class FieldDeclaration extends ExprParent, @fielddecl, Annotatable {
682682
/** Gets the number of fields declared in this declaration. */
683683
int getNumField() { result = max(int idx | fieldDeclaredIn(_, this, idx) | idx) + 1 }
684684

685+
pragma[assume_small_delta]
685686
override string toString() {
686687
if this.getNumField() = 1
687688
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
@@ -615,6 +615,7 @@ private MethodAccess callReturningSameType(Expr ref) {
615615
result.getMethod().getReturnType() = ref.getType()
616616
}
617617

618+
pragma[assume_small_delta]
618619
private SrcRefType entrypointType() {
619620
exists(RemoteFlowSource s, RefType t |
620621
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)