Merge pull request #10904 from aschackmull/java/joinorders

Java: Fix some join-orders.
This commit is contained in:
Anders Schack-Mulligen
2022-11-04 09:24:31 +01:00
committed by GitHub
12 changed files with 14 additions and 0 deletions

View File

@@ -400,6 +400,7 @@ private module ControlFlowGraphImpl {
/**
* Gets a statement that always throws an exception or calls `exit`.
*/
pragma[assume_small_delta]
private Stmt nonReturningStmt() {
result instanceof ThrowStmt
or
@@ -421,6 +422,7 @@ private module ControlFlowGraphImpl {
/**
* Gets an expression that always throws an exception or calls `exit`.
*/
pragma[assume_small_delta]
private Expr nonReturningExpr() {
result = nonReturningMethodAccess()
or

View File

@@ -2026,6 +2026,7 @@ class TypeAccess extends Expr, Annotatable, @typeaccess {
override CompilationUnit getCompilationUnit() { result = Expr.super.getCompilationUnit() }
/** Gets a printable representation of this expression. */
pragma[assume_small_delta]
override string toString() {
result = this.getQualifier().toString() + "." + this.getType().toString()
or

View File

@@ -682,6 +682,7 @@ class FieldDeclaration extends ExprParent, @fielddecl, Annotatable {
/** Gets the number of fields declared in this declaration. */
int getNumField() { result = max(int idx | fieldDeclaredIn(_, this, idx) | idx) + 1 }
pragma[assume_small_delta]
override string toString() {
if this.getNumField() = 1
then result = this.getTypeAccess() + " " + this.getField(0) + ";"

View File

@@ -304,6 +304,7 @@ private predicate hasSubtypeStar1(RefType t, RefType sub) {
/**
* Holds if `hasSubtype*(t, sub)`, but manual-magic'ed with `getAWildcardLowerBound(sub)`.
*/
pragma[assume_small_delta]
pragma[nomagic]
private predicate hasSubtypeStar2(RefType t, RefType sub) {
sub = t and getAWildcardLowerBound(sub)

View File

@@ -42,6 +42,7 @@ EqualityTest varEqualityTestExpr(SsaVariable v1, SsaVariable v2, boolean isEqual
}
/** Gets an expression that is provably not `null`. */
pragma[assume_small_delta]
Expr clearlyNotNullExpr(Expr reason) {
result instanceof ClassInstanceExpr and reason = result
or
@@ -236,6 +237,7 @@ Expr directNullGuard(SsaVariable v, boolean branch, boolean isnull) {
* If `result` evaluates to `branch`, then `v` is guaranteed to be null if `isnull`
* is true, and non-null if `isnull` is false.
*/
pragma[assume_small_delta]
Guard nullGuard(SsaVariable v, boolean branch, boolean isnull) {
result = directNullGuard(v, branch, isnull) or
exists(boolean branch0 | implies_v3(result, branch, nullGuard(v, branch0, isnull), branch0))

View File

@@ -61,6 +61,7 @@ class SsaSourceVariable extends TSsaSourceVariable {
* accessed from nested callables are therefore associated with several
* `SsaSourceVariable`s.
*/
pragma[assume_small_delta]
cached
VarAccess getAnAccess() {
exists(LocalScopeVariable v, Callable c |

View File

@@ -313,6 +313,7 @@ private module ForAll<RankedEdge Edge, TypePropagation T> {
* Holds if `t` is a candidate bound for `n` that is also valid for data coming
* through the edges into `n` ranked from `1` to `r`.
*/
pragma[assume_small_delta]
private predicate flowJoin(int r, TypeFlowNode n, T::Typ t) {
(
r = 1 and candJoinType(n, t)

View File

@@ -615,6 +615,7 @@ private MethodAccess callReturningSameType(Expr ref) {
result.getMethod().getReturnType() = ref.getType()
}
pragma[assume_small_delta]
private SrcRefType entrypointType() {
exists(RemoteFlowSource s, RefType t |
s instanceof DataFlow::ExplicitParameterNode and

View File

@@ -29,6 +29,7 @@ private Callable dispatchCand(Call c) {
/**
* Holds if `t` and all its enclosing types are public.
*/
pragma[assume_small_delta]
private predicate veryPublic(RefType t) {
t.isPublic() and
(

View File

@@ -206,6 +206,7 @@ private predicate relevantNodeBack(ObjNode n) {
exists(ObjNode mid | objStep(n, mid) and relevantNodeBack(mid))
}
pragma[assume_small_delta]
private predicate relevantNode(ObjNode n) {
source(_, n) and relevantNodeBack(n)
or

View File

@@ -11,6 +11,7 @@ class RemoteCallableMethod extends Method {
RemoteCallableMethod() { remoteCallableMethod(this) }
}
pragma[assume_small_delta]
private predicate remoteCallableMethod(Method method) {
method.getDeclaringType().getASupertype() instanceof TypeRemote
or

View File

@@ -152,6 +152,7 @@ class JacksonSerializableField extends SerializableField {
/** A field that may be deserialized using the Jackson JSON framework. */
class JacksonDeserializableField extends DeserializableField {
pragma[assume_small_delta]
JacksonDeserializableField() {
exists(JacksonDeserializableType superType |
superType = this.getDeclaringType().getAnAncestor() and