Skip to content

Commit 49d5765

Browse files
authored
Merge pull request github#14170 from hvitved/csharp/cil-arg-exclude
C#: Exclude CIL arguments from `ArgumentNode` when they are compiled from source
2 parents 2f57a62 + ecbf2d8 commit 49d5765

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,9 @@ class CilDataFlowCall extends DataFlowCall, TCilCall {
415415

416416
CilDataFlowCall() { this = TCilCall(call) }
417417

418+
/** Gets the underlying CIL call. */
419+
CIL::Call getCilCall() { result = call }
420+
418421
override DataFlowCallable getARuntimeTarget() {
419422
// There is no dispatch library for CIL, so do not consider overrides for now
420423
result.getUnderlyingCallable() = getCallableForDataFlow(call.getTarget())

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1181,7 +1181,7 @@ private module ArgumentNodes {
11811181
ExplicitArgumentNode() {
11821182
this.asExpr() instanceof Argument
11831183
or
1184-
this.asExpr() = any(CIL::Call call).getAnArgument()
1184+
this.asExpr() = any(CilDataFlowCall cc).getCilCall().getAnArgument()
11851185
}
11861186

11871187
override predicate argumentOf(DataFlowCall call, ArgumentPosition pos) {

0 commit comments

Comments
 (0)