@@ -8,15 +8,14 @@ import Expr
88private import semmle.code.csharp.dataflow.internal.DataFlowDispatch
99private import semmle.code.csharp.dataflow.internal.DataFlowImplCommon
1010private import semmle.code.csharp.dispatch.Dispatch
11- private import dotnet
1211
1312/**
1413 * A call. Either a method call (`MethodCall`), a constructor initializer call
1514 * (`ConstructorInitializer`), a call to a user-defined operator (`OperatorCall`),
1615 * a delegate call (`DelegateCall`), an accessor call (`AccessorCall`), a
1716 * constructor call (`ObjectCreation`), or a local function call (`LocalFunctionCall`).
1817 */
19- class Call extends DotNet :: Call , Expr , @call {
18+ class Call extends Expr , @call {
2019 /**
2120 * Gets the static (compile-time) target of this call. For example, the
2221 * static target of `x.M()` on line 9 is `A.M` in
@@ -38,13 +37,19 @@ class Call extends DotNet::Call, Expr, @call {
3837 * Use `getARuntimeTarget()` instead to get a potential run-time target (will
3938 * include `B.M` in the example above).
4039 */
41- override Callable getTarget ( ) { none ( ) }
40+ Callable getTarget ( ) { none ( ) }
4241
43- override Expr getArgument ( int i ) { result = this .getChild ( i ) and i >= 0 }
42+ /** Gets the `i`th argument to this call, if any. */
43+ Expr getArgument ( int i ) { result = this .getChild ( i ) and i >= 0 }
4444
45- override Expr getRawArgument ( int i ) { result = this .getArgument ( i ) }
45+ /**
46+ * Gets the `i`th "raw" argument to this call, if any.
47+ * For instance methods, argument 0 is the qualifier.
48+ */
49+ Expr getRawArgument ( int i ) { result = this .getArgument ( i ) }
4650
47- override Expr getAnArgument ( ) { result = this .getArgument ( _) }
51+ /** Gets an argument to this call. */
52+ Expr getAnArgument ( ) { result = this .getArgument ( _) }
4853
4954 /** Gets the number of arguments of this call. */
5055 int getNumberOfArguments ( ) { result = count ( this .getAnArgument ( ) ) }
@@ -59,7 +64,7 @@ class Call extends DotNet::Call, Expr, @call {
5964 * consider default arguments.
6065 */
6166 cached
62- override Expr getArgumentForParameter ( DotNet:: Parameter p ) {
67+ Expr getArgumentForParameter ( DotNet:: Parameter p ) {
6368 // Appears in the positional part of the call
6469 result = this .getImplicitArgument ( p )
6570 or
@@ -144,7 +149,7 @@ class Call extends DotNet::Call, Expr, @call {
144149 * - Line 16: There is no static target (delegate call) but the delegate `i => { }`
145150 * (line 20) is a run-time target.
146151 */
147- override Callable getARuntimeTarget ( ) {
152+ Callable getARuntimeTarget ( ) {
148153 exists ( DispatchCall dc | dc .getCall ( ) = this | result = dc .getADynamicTarget ( ) )
149154 }
150155
0 commit comments