Skip to content

Commit 0d4524f

Browse files
committed
Address review comments
1 parent 1e1a873 commit 0d4524f

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowImplSpecific.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@ module CsharpDataFlow implements InputSig<Location> {
3030
exists(n.(AssignableDefinitionNode).getDefinition().getTargetAccess())
3131
}
3232

33-
DataFlowType getSourceContextParameterNodeType() { result.isSourceContextParameterType() }
33+
DataFlowType getSourceContextParameterNodeType(Node p) {
34+
exists(p) and result.isSourceContextParameterType()
35+
}
3436
}

csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2526,6 +2526,8 @@ predicate typeStrongerThan(DataFlowType t1, DataFlowType t2) {
25262526
uselessTypebound(t2)
25272527
or
25282528
compatibleTypesDelegateLeft(t1, t2)
2529+
or
2530+
compatibleTypesSourceContextParameterTypeLeft(t1, t2)
25292531
}
25302532

25312533
/**

shared/dataflow/codeql/dataflow/DataFlow.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ signature module InputSig<LocationSig Location> {
6464
DataFlowType getNodeType(Node node);
6565

6666
/**
67-
* Gets a special type to use for parameter nodes belonging to callables with a
67+
* Gets a special type to use for parameter node `p` belonging to callables with a
6868
* source node where a source call context `FlowFeature` is used, if any.
6969
*
7070
* This can be used to prevent lambdas from being resolved, when a concrete call
@@ -90,7 +90,7 @@ signature module InputSig<LocationSig Location> {
9090
* prevent the call edge from (1) to (4). Note that the call edge from (3) to (2)
9191
* will still be valid.
9292
*/
93-
default DataFlowType getSourceContextParameterNodeType() { none() }
93+
default DataFlowType getSourceContextParameterNodeType(Node p) { none() }
9494

9595
predicate nodeIsHidden(Node node);
9696

shared/dataflow/codeql/dataflow/internal/DataFlowImplCommon.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2117,8 +2117,8 @@ module MakeImplCommon<LocationSig Location, InputSig<Location> Lang> {
21172117
private predicate typeFlowParamType(ParamNode p, Type t, boolean cc) {
21182118
exists(Callable c |
21192119
Input::dataFlowNonCallEntry(c, cc) and
2120-
if cc = true and exists(getSourceContextParameterNodeType())
2121-
then t = getSourceContextParameterNodeType()
2120+
if cc = true and exists(getSourceContextParameterNodeType(p))
2121+
then t = getSourceContextParameterNodeType(p)
21222122
else trackedParamWithType(p, t, c)
21232123
)
21242124
or

0 commit comments

Comments
 (0)