mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
C#: Extract correct method symbol as target of extension method calls
This commit is contained in:
@@ -272,6 +272,10 @@ namespace Semmle.Extraction.CSharp.Entities
|
||||
case MethodKind.Constructor:
|
||||
return Constructor.Create(cx, methodDecl);
|
||||
case MethodKind.ReducedExtension:
|
||||
return OrdinaryMethod.Create(cx,
|
||||
methodDecl.ReducedFrom!.IsGenericMethod && methodDecl.TypeArguments.Any()
|
||||
? methodDecl.ReducedFrom!.Construct(methodDecl.TypeArguments, methodDecl.TypeArgumentNullableAnnotations)
|
||||
: methodDecl.ReducedFrom!);
|
||||
case MethodKind.Ordinary:
|
||||
case MethodKind.DelegateInvoke:
|
||||
return OrdinaryMethod.Create(cx, methodDecl);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
methodCallTargets
|
||||
| methods.cs:19:13:19:22 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<int>(string, int) |
|
||||
| methods.cs:20:13:20:27 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<int>(string, int) |
|
||||
| methods.cs:21:13:21:30 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<double>(double) |
|
||||
| methods.cs:22:13:22:33 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<object>(object) |
|
||||
| methods.cs:21:13:21:30 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<double>(string, double) |
|
||||
| methods.cs:22:13:22:33 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<object>(string, object) |
|
||||
| methods.cs:23:13:23:34 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<int>(string, int) |
|
||||
| methods.cs:24:13:24:39 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<int>(string, int) |
|
||||
| methods.cs:25:13:25:42 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<double>(string, double) |
|
||||
@@ -22,8 +22,8 @@ methodCallTargets
|
||||
genericMethodCallTargets
|
||||
| methods.cs:19:13:19:22 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<int>(string, int) | methods.cs:8:28:8:34 | Ext0 | Ext0<T>(string, T) |
|
||||
| methods.cs:20:13:20:27 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<int>(string, int) | methods.cs:8:28:8:34 | Ext0 | Ext0<T>(string, T) |
|
||||
| methods.cs:21:13:21:30 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<double>(double) | methods.cs:8:28:8:34 | Ext0 | Ext0<T>(string, T) |
|
||||
| methods.cs:22:13:22:33 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<object>(object) | methods.cs:8:28:8:34 | Ext0 | Ext0<T>(string, T) |
|
||||
| methods.cs:21:13:21:30 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<double>(string, double) | methods.cs:8:28:8:34 | Ext0 | Ext0<T>(string, T) |
|
||||
| methods.cs:22:13:22:33 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<object>(string, object) | methods.cs:8:28:8:34 | Ext0 | Ext0<T>(string, T) |
|
||||
| methods.cs:23:13:23:34 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<int>(string, int) | methods.cs:8:28:8:34 | Ext0 | Ext0<T>(string, T) |
|
||||
| methods.cs:24:13:24:39 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<int>(string, int) | methods.cs:8:28:8:34 | Ext0 | Ext0<T>(string, T) |
|
||||
| methods.cs:25:13:25:42 | call to method Ext0 | methods.cs:8:28:8:34 | Ext0 | Ext0<double>(string, double) | methods.cs:8:28:8:34 | Ext0 | Ext0<T>(string, T) |
|
||||
|
||||
@@ -16,11 +16,10 @@
|
||||
| methods.cs:73:21:73:24 | F | methods.cs:73:28:73:28 | x |
|
||||
| methods.cs:78:21:78:21 | F | methods.cs:78:30:78:30 | x |
|
||||
| methods.cs:78:21:78:21 | F | methods.cs:78:40:78:40 | y |
|
||||
| methods.cs:100:27:100:33 | ToInt32 | methods.cs:100:35:100:47 | s |
|
||||
| methods.cs:100:27:100:33 | ToInt32 | methods.cs:100:47:100:47 | s |
|
||||
| methods.cs:105:28:105:33 | ToBool | methods.cs:105:47:105:47 | s |
|
||||
| methods.cs:105:28:105:33 | ToBool | methods.cs:105:69:105:69 | f |
|
||||
| methods.cs:110:27:110:34 | Slice | methods.cs:110:36:110:50 | source |
|
||||
| methods.cs:110:27:110:34 | Slice | methods.cs:110:45:110:50 | source |
|
||||
| methods.cs:110:27:110:34 | Slice | methods.cs:110:45:110:50 | source |
|
||||
| methods.cs:110:27:110:34 | Slice | methods.cs:110:57:110:61 | index |
|
||||
| methods.cs:110:27:110:34 | Slice | methods.cs:110:57:110:61 | index |
|
||||
@@ -35,7 +34,7 @@
|
||||
| methods.cs:146:14:146:20 | Method2 | methods.cs:146:65:146:65 | e |
|
||||
| methods.cs:169:27:169:30 | Plus | methods.cs:169:41:169:44 | left |
|
||||
| methods.cs:169:27:169:30 | Plus | methods.cs:169:51:169:55 | right |
|
||||
| methods.cs:174:65:174:74 | SkipTwo | methods.cs:174:76:174:126 | list |
|
||||
| methods.cs:174:65:174:74 | SkipTwo | methods.cs:174:123:174:126 | list |
|
||||
| methods.cs:174:65:174:74 | SkipTwo | methods.cs:174:123:174:126 | list |
|
||||
| methods.cs:174:65:174:74 | SkipTwo | methods.cs:174:133:174:133 | i |
|
||||
| methods.cs:174:65:174:74 | SkipTwo | methods.cs:174:133:174:133 | i |
|
||||
|
||||
Reference in New Issue
Block a user