mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Dataflow: Make use of defaults for language-specific hooks.
This commit is contained in:
@@ -79,13 +79,3 @@ class ArgumentPosition extends int {
|
|||||||
/** Holds if arguments at position `apos` match parameters at position `ppos`. */
|
/** Holds if arguments at position `apos` match parameters at position `ppos`. */
|
||||||
pragma[inline]
|
pragma[inline]
|
||||||
predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) { ppos = apos }
|
predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) { ppos = apos }
|
||||||
|
|
||||||
/**
|
|
||||||
* Holds if flow from `call`'s argument `arg` to parameter `p` is permissible.
|
|
||||||
*
|
|
||||||
* This is a temporary hook to support technical debt in the Go language; do not use.
|
|
||||||
*/
|
|
||||||
pragma[inline]
|
|
||||||
predicate golangSpecificParamArgFilter(DataFlowCall call, ParameterNode p, ArgumentNode arg) {
|
|
||||||
any()
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -297,12 +297,3 @@ class ContentApprox = Unit;
|
|||||||
/** Gets an approximated value for content `c`. */
|
/** Gets an approximated value for content `c`. */
|
||||||
pragma[inline]
|
pragma[inline]
|
||||||
ContentApprox getContentApprox(Content c) { any() }
|
ContentApprox getContentApprox(Content c) { any() }
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets an additional term that is added to the `join` and `branch` computations to reflect
|
|
||||||
* an additional forward or backwards branching factor that is not taken into account
|
|
||||||
* when calculating the (virtual) dispatch cost.
|
|
||||||
*
|
|
||||||
* Argument `arg` is part of a path from a source to a sink, and `p` is the target parameter.
|
|
||||||
*/
|
|
||||||
int getAdditionalFlowIntoCallNodeTerm(ArgumentNode arg, ParameterNode p) { none() }
|
|
||||||
|
|||||||
@@ -271,13 +271,3 @@ DataFlowCallable viableImplInCallContext(DataFlowCall call, DataFlowCall ctx) {
|
|||||||
/** Holds if arguments at position `apos` match parameters at position `ppos`. */
|
/** Holds if arguments at position `apos` match parameters at position `ppos`. */
|
||||||
pragma[inline]
|
pragma[inline]
|
||||||
predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) { ppos = apos }
|
predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) { ppos = apos }
|
||||||
|
|
||||||
/**
|
|
||||||
* Holds if flow from `call`'s argument `arg` to parameter `p` is permissible.
|
|
||||||
*
|
|
||||||
* This is a temporary hook to support technical debt in the Go language; do not use.
|
|
||||||
*/
|
|
||||||
pragma[inline]
|
|
||||||
predicate golangSpecificParamArgFilter(DataFlowCall call, ParameterNode p, ArgumentNode arg) {
|
|
||||||
any()
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -528,13 +528,3 @@ predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) {
|
|||||||
apos.isImplicitCapturedArgumentPosition(v)
|
apos.isImplicitCapturedArgumentPosition(v)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Holds if flow from `call`'s argument `arg` to parameter `p` is permissible.
|
|
||||||
*
|
|
||||||
* This is a temporary hook to support technical debt in the Go language; do not use.
|
|
||||||
*/
|
|
||||||
pragma[inline]
|
|
||||||
predicate golangSpecificParamArgFilter(DataFlowCall call, ParameterNode p, ArgumentNode arg) {
|
|
||||||
any()
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -2420,12 +2420,3 @@ module Csv {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets an additional term that is added to the `join` and `branch` computations to reflect
|
|
||||||
* an additional forward or backwards branching factor that is not taken into account
|
|
||||||
* when calculating the (virtual) dispatch cost.
|
|
||||||
*
|
|
||||||
* Argument `arg` is part of a path from a source to a sink, and `p` is the target parameter.
|
|
||||||
*/
|
|
||||||
int getAdditionalFlowIntoCallNodeTerm(ArgumentNode arg, ParameterNode p) { none() }
|
|
||||||
|
|||||||
@@ -423,12 +423,3 @@ class ContentApprox = Unit;
|
|||||||
/** Gets an approximated value for content `c`. */
|
/** Gets an approximated value for content `c`. */
|
||||||
pragma[inline]
|
pragma[inline]
|
||||||
ContentApprox getContentApprox(Content c) { any() }
|
ContentApprox getContentApprox(Content c) { any() }
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets an additional term that is added to the `join` and `branch` computations to reflect
|
|
||||||
* an additional forward or backwards branching factor that is not taken into account
|
|
||||||
* when calculating the (virtual) dispatch cost.
|
|
||||||
*
|
|
||||||
* Argument `arg` is part of a path from a source to a sink, and `p` is the target parameter.
|
|
||||||
*/
|
|
||||||
int getAdditionalFlowIntoCallNodeTerm(ArgumentNode arg, ParameterNode p) { none() }
|
|
||||||
|
|||||||
@@ -171,16 +171,6 @@ private module DispatchImpl {
|
|||||||
/** Holds if arguments at position `apos` match parameters at position `ppos`. */
|
/** Holds if arguments at position `apos` match parameters at position `ppos`. */
|
||||||
pragma[inline]
|
pragma[inline]
|
||||||
predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) { ppos = apos }
|
predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) { ppos = apos }
|
||||||
|
|
||||||
/**
|
|
||||||
* Holds if flow from `call`'s argument `arg` to parameter `p` is permissible.
|
|
||||||
*
|
|
||||||
* This is a temporary hook to support technical debt in the Go language; do not use.
|
|
||||||
*/
|
|
||||||
pragma[inline]
|
|
||||||
predicate golangSpecificParamArgFilter(DataFlowCall call, ParameterNode p, ArgumentNode arg) {
|
|
||||||
any()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
import DispatchImpl
|
import DispatchImpl
|
||||||
|
|||||||
@@ -593,12 +593,3 @@ predicate containerContent(Content c) {
|
|||||||
c instanceof MapKeyContent or
|
c instanceof MapKeyContent or
|
||||||
c instanceof MapValueContent
|
c instanceof MapValueContent
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets an additional term that is added to the `join` and `branch` computations to reflect
|
|
||||||
* an additional forward or backwards branching factor that is not taken into account
|
|
||||||
* when calculating the (virtual) dispatch cost.
|
|
||||||
*
|
|
||||||
* Argument `arg` is part of a path from a source to a sink, and `p` is the target parameter.
|
|
||||||
*/
|
|
||||||
int getAdditionalFlowIntoCallNodeTerm(ArgumentNode arg, ParameterNode p) { none() }
|
|
||||||
|
|||||||
@@ -1639,13 +1639,3 @@ private module OutNodes {
|
|||||||
* `kind`.
|
* `kind`.
|
||||||
*/
|
*/
|
||||||
OutNode getAnOutNode(DataFlowCall call, ReturnKind kind) { call = result.getCall(kind) }
|
OutNode getAnOutNode(DataFlowCall call, ReturnKind kind) { call = result.getCall(kind) }
|
||||||
|
|
||||||
/**
|
|
||||||
* Holds if flow from `call`'s argument `arg` to parameter `p` is permissible.
|
|
||||||
*
|
|
||||||
* This is a temporary hook to support technical debt in the Go language; do not use.
|
|
||||||
*/
|
|
||||||
pragma[inline]
|
|
||||||
predicate golangSpecificParamArgFilter(DataFlowCall call, ParameterNode p, ArgumentNode arg) {
|
|
||||||
any()
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1002,12 +1002,3 @@ class ContentApprox = Unit;
|
|||||||
/** Gets an approximated value for content `c`. */
|
/** Gets an approximated value for content `c`. */
|
||||||
pragma[inline]
|
pragma[inline]
|
||||||
ContentApprox getContentApprox(Content c) { any() }
|
ContentApprox getContentApprox(Content c) { any() }
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets an additional term that is added to the `join` and `branch` computations to reflect
|
|
||||||
* an additional forward or backwards branching factor that is not taken into account
|
|
||||||
* when calculating the (virtual) dispatch cost.
|
|
||||||
*
|
|
||||||
* Argument `arg` is part of a path from a source to a sink, and `p` is the target parameter.
|
|
||||||
*/
|
|
||||||
int getAdditionalFlowIntoCallNodeTerm(ArgumentNode arg, ParameterNode p) { none() }
|
|
||||||
|
|||||||
@@ -1456,13 +1456,3 @@ predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) {
|
|||||||
or
|
or
|
||||||
apos.isAnyNamed() and ppos.isKeyword(_)
|
apos.isAnyNamed() and ppos.isKeyword(_)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Holds if flow from `call`'s argument `arg` to parameter `p` is permissible.
|
|
||||||
*
|
|
||||||
* This is a temporary hook to support technical debt in the Go language; do not use.
|
|
||||||
*/
|
|
||||||
pragma[inline]
|
|
||||||
predicate golangSpecificParamArgFilter(DataFlowCall call, ParameterNodeImpl p, ArgumentNode arg) {
|
|
||||||
any()
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1972,12 +1972,3 @@ class AdditionalJumpStep extends Unit {
|
|||||||
*/
|
*/
|
||||||
abstract predicate step(Node pred, Node succ);
|
abstract predicate step(Node pred, Node succ);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets an additional term that is added to the `join` and `branch` computations to reflect
|
|
||||||
* an additional forward or backwards branching factor that is not taken into account
|
|
||||||
* when calculating the (virtual) dispatch cost.
|
|
||||||
*
|
|
||||||
* Argument `arg` is part of a path from a source to a sink, and `p` is the target parameter.
|
|
||||||
*/
|
|
||||||
int getAdditionalFlowIntoCallNodeTerm(ArgumentNode arg, ParameterNodeImpl p) { none() }
|
|
||||||
|
|||||||
@@ -226,9 +226,13 @@ signature module InputSig {
|
|||||||
*
|
*
|
||||||
* Argument `arg` is part of a path from a source to a sink, and `p` is the target parameter.
|
* Argument `arg` is part of a path from a source to a sink, and `p` is the target parameter.
|
||||||
*/
|
*/
|
||||||
int getAdditionalFlowIntoCallNodeTerm(ArgumentNode arg, ParameterNode p);
|
default int getAdditionalFlowIntoCallNodeTerm(ArgumentNode arg, ParameterNode p) { none() }
|
||||||
|
|
||||||
predicate golangSpecificParamArgFilter(DataFlowCall call, ParameterNode p, ArgumentNode arg);
|
default predicate golangSpecificParamArgFilter(
|
||||||
|
DataFlowCall call, ParameterNode p, ArgumentNode arg
|
||||||
|
) {
|
||||||
|
any()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module Configs<InputSig Lang> {
|
module Configs<InputSig Lang> {
|
||||||
|
|||||||
@@ -355,13 +355,3 @@ predicate parameterMatch(ParameterPosition ppos, ArgumentPosition apos) {
|
|||||||
or
|
or
|
||||||
ppos.(PositionalParameterPosition).getIndex() = apos.(PositionalArgumentPosition).getIndex()
|
ppos.(PositionalParameterPosition).getIndex() = apos.(PositionalArgumentPosition).getIndex()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Holds if flow from `call`'s argument `arg` to parameter `p` is permissible.
|
|
||||||
*
|
|
||||||
* This is a temporary hook to support technical debt in the Go language; do not use.
|
|
||||||
*/
|
|
||||||
pragma[inline]
|
|
||||||
predicate golangSpecificParamArgFilter(DataFlowCall call, ParameterNode p, ArgumentNode arg) {
|
|
||||||
any()
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -1148,12 +1148,3 @@ class ContentApprox = Unit;
|
|||||||
/** Gets an approximated value for content `c`. */
|
/** Gets an approximated value for content `c`. */
|
||||||
pragma[inline]
|
pragma[inline]
|
||||||
ContentApprox getContentApprox(Content c) { any() }
|
ContentApprox getContentApprox(Content c) { any() }
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets an additional term that is added to the `join` and `branch` computations to reflect
|
|
||||||
* an additional forward or backwards branching factor that is not taken into account
|
|
||||||
* when calculating the (virtual) dispatch cost.
|
|
||||||
*
|
|
||||||
* Argument `arg` is part of a path from a source to a sink, and `p` is the target parameter.
|
|
||||||
*/
|
|
||||||
int getAdditionalFlowIntoCallNodeTerm(ArgumentNode arg, ParameterNode p) { none() }
|
|
||||||
|
|||||||
Reference in New Issue
Block a user