mirror of
https://github.com/github/codeql.git
synced 2026-04-11 18:14:01 +02:00
Address review comments
This commit is contained in:
@@ -30,5 +30,7 @@ module CsharpDataFlow implements InputSig<Location> {
|
||||
exists(n.(AssignableDefinitionNode).getDefinition().getTargetAccess())
|
||||
}
|
||||
|
||||
DataFlowType getSourceContextParameterNodeType() { result.isSourceContextParameterType() }
|
||||
DataFlowType getSourceContextParameterNodeType(Node p) {
|
||||
exists(p) and result.isSourceContextParameterType()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2526,6 +2526,8 @@ predicate typeStrongerThan(DataFlowType t1, DataFlowType t2) {
|
||||
uselessTypebound(t2)
|
||||
or
|
||||
compatibleTypesDelegateLeft(t1, t2)
|
||||
or
|
||||
compatibleTypesSourceContextParameterTypeLeft(t1, t2)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -64,7 +64,7 @@ signature module InputSig<LocationSig Location> {
|
||||
DataFlowType getNodeType(Node node);
|
||||
|
||||
/**
|
||||
* Gets a special type to use for parameter nodes belonging to callables with a
|
||||
* Gets a special type to use for parameter node `p` belonging to callables with a
|
||||
* source node where a source call context `FlowFeature` is used, if any.
|
||||
*
|
||||
* This can be used to prevent lambdas from being resolved, when a concrete call
|
||||
@@ -90,7 +90,7 @@ signature module InputSig<LocationSig Location> {
|
||||
* prevent the call edge from (1) to (4). Note that the call edge from (3) to (2)
|
||||
* will still be valid.
|
||||
*/
|
||||
default DataFlowType getSourceContextParameterNodeType() { none() }
|
||||
default DataFlowType getSourceContextParameterNodeType(Node p) { none() }
|
||||
|
||||
predicate nodeIsHidden(Node node);
|
||||
|
||||
|
||||
@@ -2117,8 +2117,8 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
|
||||
private predicate typeFlowParamType(ParamNode p, Type t, boolean cc) {
|
||||
exists(Callable c |
|
||||
Input::dataFlowNonCallEntry(c, cc) and
|
||||
if cc = true and exists(getSourceContextParameterNodeType())
|
||||
then t = getSourceContextParameterNodeType()
|
||||
if cc = true and exists(getSourceContextParameterNodeType(p))
|
||||
then t = getSourceContextParameterNodeType(p)
|
||||
else trackedParamWithType(p, t, c)
|
||||
)
|
||||
or
|
||||
|
||||
Reference in New Issue
Block a user