@@ -8,15 +8,14 @@ import Expr
8
8
private import semmle.code.csharp.dataflow.internal.DataFlowDispatch
9
9
private import semmle.code.csharp.dataflow.internal.DataFlowImplCommon
10
10
private import semmle.code.csharp.dispatch.Dispatch
11
- private import dotnet
12
11
13
12
/**
14
13
* A call. Either a method call (`MethodCall`), a constructor initializer call
15
14
* (`ConstructorInitializer`), a call to a user-defined operator (`OperatorCall`),
16
15
* a delegate call (`DelegateCall`), an accessor call (`AccessorCall`), a
17
16
* constructor call (`ObjectCreation`), or a local function call (`LocalFunctionCall`).
18
17
*/
19
- class Call extends DotNet :: Call , Expr , @call {
18
+ class Call extends Expr , @call {
20
19
/**
21
20
* Gets the static (compile-time) target of this call. For example, the
22
21
* static target of `x.M()` on line 9 is `A.M` in
@@ -38,13 +37,19 @@ class Call extends DotNet::Call, Expr, @call {
38
37
* Use `getARuntimeTarget()` instead to get a potential run-time target (will
39
38
* include `B.M` in the example above).
40
39
*/
41
- override Callable getTarget ( ) { none ( ) }
40
+ Callable getTarget ( ) { none ( ) }
42
41
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 }
44
44
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 ) }
46
50
47
- override Expr getAnArgument ( ) { result = this .getArgument ( _) }
51
+ /** Gets an argument to this call. */
52
+ Expr getAnArgument ( ) { result = this .getArgument ( _) }
48
53
49
54
/** Gets the number of arguments of this call. */
50
55
int getNumberOfArguments ( ) { result = count ( this .getAnArgument ( ) ) }
@@ -59,7 +64,7 @@ class Call extends DotNet::Call, Expr, @call {
59
64
* consider default arguments.
60
65
*/
61
66
cached
62
- override Expr getArgumentForParameter ( DotNet:: Parameter p ) {
67
+ Expr getArgumentForParameter ( DotNet:: Parameter p ) {
63
68
// Appears in the positional part of the call
64
69
result = this .getImplicitArgument ( p )
65
70
or
@@ -144,7 +149,7 @@ class Call extends DotNet::Call, Expr, @call {
144
149
* - Line 16: There is no static target (delegate call) but the delegate `i => { }`
145
150
* (line 20) is a run-time target.
146
151
*/
147
- override Callable getARuntimeTarget ( ) {
152
+ Callable getARuntimeTarget ( ) {
148
153
exists ( DispatchCall dc | dc .getCall ( ) = this | result = dc .getADynamicTarget ( ) )
149
154
}
150
155
0 commit comments