diff --git a/java/ql/lib/semmle/code/java/Type.qll b/java/ql/lib/semmle/code/java/Type.qll index 07e9df9d282..95e4ecc7ff7 100644 --- a/java/ql/lib/semmle/code/java/Type.qll +++ b/java/ql/lib/semmle/code/java/Type.qll @@ -670,6 +670,7 @@ class RefType extends Type, Annotatable, Modifiable, @reftype { * * For the definition of the notion of *erasure* see JLS v8, section 4.6 (Type Erasure). */ + overlay[caller] pragma[inline] RefType commonSubtype(RefType other) { result.getASourceSupertype*() = erase(this) and @@ -1259,6 +1260,7 @@ private Type erase(Type t) { * * For the definition of the notion of *erasure* see JLS v8, section 4.6 (Type Erasure). */ +overlay[caller] pragma[inline] predicate haveIntersection(RefType t1, RefType t2) { exists(RefType e1, RefType e2 | e1 = erase(t1) and e2 = erase(t2) | diff --git a/java/ql/lib/semmle/code/java/controlflow/Dominance.qll b/java/ql/lib/semmle/code/java/controlflow/Dominance.qll index 9e87ac6a8dd..cb53e3f9fe1 100644 --- a/java/ql/lib/semmle/code/java/controlflow/Dominance.qll +++ b/java/ql/lib/semmle/code/java/controlflow/Dominance.qll @@ -111,6 +111,7 @@ predicate iDominates(ControlFlowNode dominator, ControlFlowNode node) { } /** Holds if `dom` strictly dominates `node`. */ +overlay[caller] pragma[inline] predicate strictlyDominates(ControlFlowNode dom, ControlFlowNode node) { // This predicate is gigantic, so it must be inlined. @@ -120,6 +121,7 @@ predicate strictlyDominates(ControlFlowNode dom, ControlFlowNode node) { } /** Holds if `dom` dominates `node`. (This is reflexive.) */ +overlay[caller] pragma[inline] predicate dominates(ControlFlowNode dom, ControlFlowNode node) { // This predicate is gigantic, so it must be inlined. @@ -129,6 +131,7 @@ predicate dominates(ControlFlowNode dom, ControlFlowNode node) { } /** Holds if `dom` strictly post-dominates `node`. */ +overlay[caller] pragma[inline] predicate strictlyPostDominates(ControlFlowNode dom, ControlFlowNode node) { // This predicate is gigantic, so it must be inlined. @@ -138,6 +141,7 @@ predicate strictlyPostDominates(ControlFlowNode dom, ControlFlowNode node) { } /** Holds if `dom` post-dominates `node`. (This is reflexive.) */ +overlay[caller] pragma[inline] predicate postDominates(ControlFlowNode dom, ControlFlowNode node) { // This predicate is gigantic, so it must be inlined. diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll index b1be9ce453e..9a1be72209a 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll @@ -213,6 +213,7 @@ private module DispatchImpl { } /** Holds if arguments at position `apos` match parameters at position `ppos`. */ + overlay[caller] pragma[inline] predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) { ppos = apos } } diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll index d1ef8cf5b61..dc924d65f09 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowUtil.qll @@ -79,6 +79,7 @@ private module ThisFlow { * Holds if data can flow from `node1` to `node2` in zero or more * local (intra-procedural) steps. */ +overlay[caller] pragma[inline] predicate localFlow(Node node1, Node node2) { node1 = node2 or localFlowStepPlus(node1, node2) } @@ -88,6 +89,7 @@ private predicate localFlowStepPlus(Node node1, Node node2) = fastTC(localFlowSt * Holds if data can flow from `e1` to `e2` in zero or more * local (intra-procedural) steps. */ +overlay[caller] pragma[inline] predicate localExprFlow(Expr e1, Expr e2) { localFlow(exprNode(e1), exprNode(e2)) } diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll b/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll index 6243275180f..ed0163d13a7 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/TaintTrackingUtil.qll @@ -23,6 +23,7 @@ private import semmle.code.java.frameworks.JaxWS * Holds if taint can flow from `src` to `sink` in zero or more * local (intra-procedural) steps. */ +overlay[caller] pragma[inline] predicate localTaint(DataFlow::Node src, DataFlow::Node sink) { localTaintStep*(src, sink) } @@ -30,6 +31,7 @@ predicate localTaint(DataFlow::Node src, DataFlow::Node sink) { localTaintStep*( * Holds if taint can flow from `src` to `sink` in zero or more * local (intra-procedural) steps. */ +overlay[caller] pragma[inline] predicate localExprTaint(Expr src, Expr sink) { localTaint(DataFlow::exprNode(src), DataFlow::exprNode(sink)) @@ -72,6 +74,7 @@ module LocalTaintFlow { * (intra-procedural) steps that are restricted to be part of a path between * `source` and `sink`. */ + overlay[caller] pragma[inline] predicate hasFlow(DataFlow::Node n1, DataFlow::Node n2) { step*(n1, n2) } @@ -80,6 +83,7 @@ module LocalTaintFlow { * (intra-procedural) steps that are restricted to be part of a path between * `source` and `sink`. */ + overlay[caller] pragma[inline] predicate hasExprFlow(Expr n1, Expr n2) { hasFlow(DataFlow::exprNode(n1), DataFlow::exprNode(n2)) diff --git a/java/ql/src/Language Abuse/TypeVariableHidesType.ql b/java/ql/src/Language Abuse/TypeVariableHidesType.ql index d411c3848e2..f2351deee64 100644 --- a/java/ql/src/Language Abuse/TypeVariableHidesType.ql +++ b/java/ql/src/Language Abuse/TypeVariableHidesType.ql @@ -19,6 +19,7 @@ RefType anOuterType(TypeVariable var) { result = anOuterType(var).(NestedType).getEnclosingType() } +overlay[caller] pragma[inline] RefType aTypeVisibleFrom(TypeVariable var) { result = anOuterType(var) diff --git a/java/ql/src/experimental/Security/CWE/CWE-1004/SensitiveCookieNotHttpOnly.ql b/java/ql/src/experimental/Security/CWE/CWE-1004/SensitiveCookieNotHttpOnly.ql index fa5237d32bb..ff3b0cfaf6a 100644 --- a/java/ql/src/experimental/Security/CWE/CWE-1004/SensitiveCookieNotHttpOnly.ql +++ b/java/ql/src/experimental/Security/CWE/CWE-1004/SensitiveCookieNotHttpOnly.ql @@ -83,6 +83,7 @@ class CookieClass extends RefType { /** Holds if `expr` is any boolean-typed expression other than literal `false`. */ // Inlined because this could be a very large result set if computed out of context +overlay[caller] pragma[inline] predicate mayBeBooleanTrue(Expr expr) { expr.getType() instanceof BooleanType and diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll index 6a7bef33cc9..af6ca238a20 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll @@ -744,6 +744,7 @@ module MakeImpl Lang> { viableImplNotCallContextReducedInlineLate(call, outercc) } + overlay[caller] pragma[inline] private predicate fwdFlowInCand( Call call, ArgNd arg, Cc outercc, Callable inner, ParamNd p, SummaryCtx summaryCtx, @@ -758,6 +759,7 @@ module MakeImpl Lang> { callEdgeArgParamRestrictedInlineLate(call, inner, arg, p, emptyAp) } + overlay[caller] pragma[inline] private predicate fwdFlowInCandTypeFlowDisabled( Call call, ArgNd arg, Cc outercc, Callable inner, ParamNd p, SummaryCtx summaryCtx, @@ -794,6 +796,7 @@ module MakeImpl Lang> { innercc = getCallContextCall(call, inner) } + overlay[caller] pragma[inline] predicate fwdFlowIn( Call call, ArgNd arg, Callable inner, ParamNd p, Cc outercc, CcCall innercc, @@ -2323,6 +2326,7 @@ module MakeImpl Lang> { * For more information, see * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). */ + overlay[caller] pragma[inline] deprecated final predicate hasLocationInfo( string filepath, int startline, int startcolumn, int endline, int endcolumn @@ -2526,6 +2530,7 @@ module MakeImpl Lang> { class ApHeadContent = Unit; + overlay[caller] pragma[inline] ApHeadContent getHeadContent(Ap ap) { exists(result) and ap = true } diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll index a01b2b14f2e..b2bdc0c12e6 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll @@ -677,6 +677,7 @@ module MakeImplCommon Lang> { class CcCall = CallContextCall; + overlay[caller] pragma[inline] predicate matchesCall(CcCall cc, Call call) { cc = Input2::getSpecificCallContextCall(call, _) or @@ -888,6 +889,7 @@ module MakeImplCommon Lang> { pragma[nomagic] private Callable getEnclosingCallable0() { nodeEnclosingCallable(this.projectToNode(), result) } + overlay[caller] pragma[inline] Callable getEnclosingCallable() { pragma[only_bind_out](this).getEnclosingCallable0() = pragma[only_bind_into](result) @@ -902,6 +904,7 @@ module MakeImplCommon Lang> { isTopType(result) and this.isImplicitReadNode(_) } + overlay[caller] pragma[inline] Type getType() { pragma[only_bind_out](this).getType0() = pragma[only_bind_into](result) } @@ -2413,12 +2416,14 @@ module MakeImplCommon Lang> { * predicate ensures that joins go from `n` to the result instead of the other * way around. */ + overlay[caller] pragma[inline] Callable getNodeEnclosingCallable(Node n) { nodeEnclosingCallable(pragma[only_bind_out](n), pragma[only_bind_into](result)) } /** Gets the type of `n` used for type pruning. */ + overlay[caller] pragma[inline] Type getNodeDataFlowType(Node n) { nodeType(pragma[only_bind_out](n), pragma[only_bind_into](result)) diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll index 498f2392fde..07147fc5667 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImplStage1.qll @@ -1786,6 +1786,7 @@ module MakeImplStage1 Lang> { * For more information, see * [Locations](https://codeql.github.com/docs/writing-codeql-queries/providing-locations-in-codeql-queries/). */ + overlay[caller] pragma[inline] deprecated predicate hasLocationInfo( string filepath, int startline, int startcolumn, int endline, int endcolumn diff --git a/shared/regex/codeql/regex/nfa/SuperlinearBackTracking.qll b/shared/regex/codeql/regex/nfa/SuperlinearBackTracking.qll index cd3be290139..2faac9b0211 100644 --- a/shared/regex/codeql/regex/nfa/SuperlinearBackTracking.qll +++ b/shared/regex/codeql/regex/nfa/SuperlinearBackTracking.qll @@ -101,6 +101,7 @@ module Make { /** * Holds if the tuple `(r1, r2, r3)` might be on path from a start-state to an end-state in the product automaton. */ + overlay[caller] pragma[inline] predicate isFeasibleTuple(State r1, State r2, State r3) { // The first element is either inside a repetition (or the start state itself) diff --git a/shared/typeinference/codeql/typeinference/internal/TypeInference.qll b/shared/typeinference/codeql/typeinference/internal/TypeInference.qll index f84b6a0d65a..99578b557d7 100644 --- a/shared/typeinference/codeql/typeinference/internal/TypeInference.qll +++ b/shared/typeinference/codeql/typeinference/internal/TypeInference.qll @@ -346,6 +346,7 @@ module Make1 Input1> { ) } + overlay[caller] pragma[inline] predicate baseTypeMentionHasNonTypeParameterAt( Type sub, TypeMention baseMention, TypePath path, Type t @@ -353,6 +354,7 @@ module Make1 Input1> { not t = sub.getATypeParameter() and baseTypeMentionHasTypeAt(sub, baseMention, path, t) } + overlay[caller] pragma[inline] predicate baseTypeMentionHasTypeParameterAt( Type sub, TypeMention baseMention, TypePath path, TypeParameter tp diff --git a/shared/typetracking/codeql/typetracking/internal/TypeTrackingImpl.qll b/shared/typetracking/codeql/typetracking/internal/TypeTrackingImpl.qll index 525ec9523f9..b74f803131f 100644 --- a/shared/typetracking/codeql/typetracking/internal/TypeTrackingImpl.qll +++ b/shared/typetracking/codeql/typetracking/internal/TypeTrackingImpl.qll @@ -512,6 +512,7 @@ module TypeTracking I> { * } * ``` */ + overlay[caller] pragma[inline] TypeTracker smallstep(Node nodeFrom, Node nodeTo) { result = this.smallstepNoSimpleLocalFlowStep(nodeFrom, nodeTo) @@ -656,6 +657,7 @@ module TypeTracking I> { * } * ``` */ + overlay[caller] pragma[inline] TypeBackTracker smallstep(Node nodeFrom, Node nodeTo) { result = this.smallstepNoSimpleLocalFlowStep(nodeFrom, nodeTo)