C#: Exclude CIL arguments from ArgumentNode when they are compiled from source

This commit is contained in:
Tom Hvitved
2023-09-08 14:14:06 +02:00
parent f720528368
commit ecbf2d8b13
2 changed files with 4 additions and 1 deletions

View File

@@ -415,6 +415,9 @@ class CilDataFlowCall extends DataFlowCall, TCilCall {
CilDataFlowCall() { this = TCilCall(call) }
/** Gets the underlying CIL call. */
CIL::Call getCilCall() { result = call }
override DataFlowCallable getARuntimeTarget() {
// There is no dispatch library for CIL, so do not consider overrides for now
result.getUnderlyingCallable() = getCallableForDataFlow(call.getTarget())

View File

@@ -1181,7 +1181,7 @@ private module ArgumentNodes {
ExplicitArgumentNode() {
this.asExpr() instanceof Argument
or
this.asExpr() = any(CIL::Call call).getAnArgument()
this.asExpr() = any(CilDataFlowCall cc).getCilCall().getAnArgument()
}
override predicate argumentOf(DataFlowCall call, ArgumentPosition pos) {