C#: Port and extend type dispatch tests from Java

This commit is contained in:
Tom Hvitved
2023-09-22 09:34:11 +02:00
parent 13ad6f8690
commit 09063c5189
4 changed files with 293 additions and 0 deletions

View File

@@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
using System.Linq;
public class A
{
static T Source<T>(T source) => throw null;
public static void Sink<T>(T t) { }
interface MyConsumer
{
void run(Object o);
}
static void Apply1<T>(Action<T> f, T x)
{
f(x);
}
static void ApplyWrap1<T>(Action<T> f, T x)
{
Apply1(f, x);
}
void TestLambdaDispatch1()
{
ApplyWrap1(x => { Sink(x); }, Source("A")); // $ hasValueFlow=A
ApplyWrap1(x => { Sink(x); }, "B"); // no flow
ApplyWrap1(x => { }, Source("C"));
ApplyWrap1(x => { }, "D");
}
void ListForEachWrap<T>(List<T> l, Action<T> f)
{
l.ForEach(f);
}
void TestLambdaDispatch2()
{
var tainted = new List<string> { Source("E") };
var safe = new List<string>();
ListForEachWrap(safe, x => { Sink(x); }); // no flow
ListForEachWrap(tainted, x => { Sink(x); }); // $ hasValueFlow=E
}
static void Apply2<T>(Action<T> f, T x)
{
f(x);
}
static void ApplyWrap2<T>(Action<T> f, T x)
{
Apply2(f, x);
}
void SinkMethodGroup1<T>(T t) => Sink(t); // $ hasValueFlow=F $ hasValueFlow=G
void SinkMethodGroup2<T>(T t) => Sink(t);
void TestLambdaDispatch3()
{
ApplyWrap2(SinkMethodGroup1, Source("F"));
ApplyWrap2(SinkMethodGroup2, "B");
}
void ForEach<T>(List<T> l, Action<T> f)
{
foreach (var x in l)
f(x);
}
void ForEachWrap<T>(List<T> l, Action<T> f)
{
ForEach(l, f);
}
void TestLambdaDispatch4()
{
var tainted = new List<string> { Source("G") };
var safe = new List<string>();
ForEachWrap(safe, SinkMethodGroup2);
ForEachWrap(tainted, SinkMethodGroup1);
}
class TaintedClass
{
public override string ToString() => Source("TaintedClass");
}
class SafeClass
{
public override string ToString() => "safe";
}
string ConvertToString(object o) => o.ToString();
string ConvertToStringWrap(object o) => ConvertToString(o);
void TestToString1()
{
var unused = ConvertToStringWrap(new TaintedClass());
Sink(ConvertToStringWrap(new SafeClass())); // no flow
}
}

View File

@@ -0,0 +1,175 @@
testFailures
| TypeFlowDispatch.cs:28:32:28:32 | access to parameter x | Unexpected result: hasValueFlow=C |
| TypeFlowDispatch.cs:29:32:29:32 | access to parameter x | Unexpected result: hasValueFlow=A |
| TypeFlowDispatch.cs:29:32:29:32 | access to parameter x | Unexpected result: hasValueFlow=C |
| TypeFlowDispatch.cs:43:43:43:43 | access to parameter x | Unexpected result: hasValueFlow=E |
| TypeFlowDispatch.cs:58:43:58:43 | access to parameter t | Unexpected result: hasValueFlow=F |
| TypeFlowDispatch.cs:58:43:58:43 | access to parameter t | Unexpected result: hasValueFlow=G |
edges
| TypeFlowDispatch.cs:16:42:16:42 | x : String | TypeFlowDispatch.cs:18:11:18:11 | access to parameter x : String |
| TypeFlowDispatch.cs:16:42:16:42 | x : String | TypeFlowDispatch.cs:18:11:18:11 | access to parameter x : String |
| TypeFlowDispatch.cs:18:11:18:11 | access to parameter x : String | TypeFlowDispatch.cs:28:20:28:20 | x : String |
| TypeFlowDispatch.cs:18:11:18:11 | access to parameter x : String | TypeFlowDispatch.cs:28:20:28:20 | x : String |
| TypeFlowDispatch.cs:18:11:18:11 | access to parameter x : String | TypeFlowDispatch.cs:29:20:29:20 | x : String |
| TypeFlowDispatch.cs:18:11:18:11 | access to parameter x : String | TypeFlowDispatch.cs:29:20:29:20 | x : String |
| TypeFlowDispatch.cs:21:46:21:46 | x : String | TypeFlowDispatch.cs:23:19:23:19 | access to parameter x : String |
| TypeFlowDispatch.cs:21:46:21:46 | x : String | TypeFlowDispatch.cs:23:19:23:19 | access to parameter x : String |
| TypeFlowDispatch.cs:23:19:23:19 | access to parameter x : String | TypeFlowDispatch.cs:16:42:16:42 | x : String |
| TypeFlowDispatch.cs:23:19:23:19 | access to parameter x : String | TypeFlowDispatch.cs:16:42:16:42 | x : String |
| TypeFlowDispatch.cs:28:20:28:20 | x : String | TypeFlowDispatch.cs:28:32:28:32 | access to parameter x |
| TypeFlowDispatch.cs:28:20:28:20 | x : String | TypeFlowDispatch.cs:28:32:28:32 | access to parameter x |
| TypeFlowDispatch.cs:28:39:28:49 | call to method Source<String> : String | TypeFlowDispatch.cs:21:46:21:46 | x : String |
| TypeFlowDispatch.cs:28:39:28:49 | call to method Source<String> : String | TypeFlowDispatch.cs:21:46:21:46 | x : String |
| TypeFlowDispatch.cs:29:20:29:20 | x : String | TypeFlowDispatch.cs:29:32:29:32 | access to parameter x |
| TypeFlowDispatch.cs:29:20:29:20 | x : String | TypeFlowDispatch.cs:29:32:29:32 | access to parameter x |
| TypeFlowDispatch.cs:30:30:30:40 | call to method Source<String> : String | TypeFlowDispatch.cs:21:46:21:46 | x : String |
| TypeFlowDispatch.cs:30:30:30:40 | call to method Source<String> : String | TypeFlowDispatch.cs:21:46:21:46 | x : String |
| TypeFlowDispatch.cs:34:37:34:37 | l : List<T> [element] : String | TypeFlowDispatch.cs:36:9:36:9 | access to parameter l : List<T> [element] : String |
| TypeFlowDispatch.cs:34:37:34:37 | l : List<T> [element] : String | TypeFlowDispatch.cs:36:9:36:9 | access to parameter l : List<T> [element] : String |
| TypeFlowDispatch.cs:36:9:36:9 | access to parameter l : List<T> [element] : String | TypeFlowDispatch.cs:43:31:43:31 | x : String |
| TypeFlowDispatch.cs:36:9:36:9 | access to parameter l : List<T> [element] : String | TypeFlowDispatch.cs:43:31:43:31 | x : String |
| TypeFlowDispatch.cs:36:9:36:9 | access to parameter l : List<T> [element] : String | TypeFlowDispatch.cs:44:34:44:34 | x : String |
| TypeFlowDispatch.cs:36:9:36:9 | access to parameter l : List<T> [element] : String | TypeFlowDispatch.cs:44:34:44:34 | x : String |
| TypeFlowDispatch.cs:41:23:41:54 | object creation of type List<String> : List<T> [element] : String | TypeFlowDispatch.cs:44:25:44:31 | access to local variable tainted : List<T> [element] : String |
| TypeFlowDispatch.cs:41:23:41:54 | object creation of type List<String> : List<T> [element] : String | TypeFlowDispatch.cs:44:25:44:31 | access to local variable tainted : List<T> [element] : String |
| TypeFlowDispatch.cs:41:42:41:52 | call to method Source<String> : String | TypeFlowDispatch.cs:41:23:41:54 | object creation of type List<String> : List<T> [element] : String |
| TypeFlowDispatch.cs:41:42:41:52 | call to method Source<String> : String | TypeFlowDispatch.cs:41:23:41:54 | object creation of type List<String> : List<T> [element] : String |
| TypeFlowDispatch.cs:43:31:43:31 | x : String | TypeFlowDispatch.cs:43:43:43:43 | access to parameter x |
| TypeFlowDispatch.cs:43:31:43:31 | x : String | TypeFlowDispatch.cs:43:43:43:43 | access to parameter x |
| TypeFlowDispatch.cs:44:25:44:31 | access to local variable tainted : List<T> [element] : String | TypeFlowDispatch.cs:34:37:34:37 | l : List<T> [element] : String |
| TypeFlowDispatch.cs:44:25:44:31 | access to local variable tainted : List<T> [element] : String | TypeFlowDispatch.cs:34:37:34:37 | l : List<T> [element] : String |
| TypeFlowDispatch.cs:44:34:44:34 | x : String | TypeFlowDispatch.cs:44:46:44:46 | access to parameter x |
| TypeFlowDispatch.cs:44:34:44:34 | x : String | TypeFlowDispatch.cs:44:46:44:46 | access to parameter x |
| TypeFlowDispatch.cs:47:42:47:42 | x : String | TypeFlowDispatch.cs:49:11:49:11 | access to parameter x : String |
| TypeFlowDispatch.cs:47:42:47:42 | x : String | TypeFlowDispatch.cs:49:11:49:11 | access to parameter x : String |
| TypeFlowDispatch.cs:49:11:49:11 | access to parameter x : String | TypeFlowDispatch.cs:57:32:57:32 | t : String |
| TypeFlowDispatch.cs:49:11:49:11 | access to parameter x : String | TypeFlowDispatch.cs:57:32:57:32 | t : String |
| TypeFlowDispatch.cs:49:11:49:11 | access to parameter x : String | TypeFlowDispatch.cs:58:32:58:32 | t : String |
| TypeFlowDispatch.cs:49:11:49:11 | access to parameter x : String | TypeFlowDispatch.cs:58:32:58:32 | t : String |
| TypeFlowDispatch.cs:52:46:52:46 | x : String | TypeFlowDispatch.cs:54:19:54:19 | access to parameter x : String |
| TypeFlowDispatch.cs:52:46:52:46 | x : String | TypeFlowDispatch.cs:54:19:54:19 | access to parameter x : String |
| TypeFlowDispatch.cs:54:19:54:19 | access to parameter x : String | TypeFlowDispatch.cs:47:42:47:42 | x : String |
| TypeFlowDispatch.cs:54:19:54:19 | access to parameter x : String | TypeFlowDispatch.cs:47:42:47:42 | x : String |
| TypeFlowDispatch.cs:57:32:57:32 | t : String | TypeFlowDispatch.cs:57:43:57:43 | access to parameter t |
| TypeFlowDispatch.cs:57:32:57:32 | t : String | TypeFlowDispatch.cs:57:43:57:43 | access to parameter t |
| TypeFlowDispatch.cs:58:32:58:32 | t : String | TypeFlowDispatch.cs:58:43:58:43 | access to parameter t |
| TypeFlowDispatch.cs:58:32:58:32 | t : String | TypeFlowDispatch.cs:58:43:58:43 | access to parameter t |
| TypeFlowDispatch.cs:62:38:62:48 | call to method Source<String> : String | TypeFlowDispatch.cs:52:46:52:46 | x : String |
| TypeFlowDispatch.cs:62:38:62:48 | call to method Source<String> : String | TypeFlowDispatch.cs:52:46:52:46 | x : String |
| TypeFlowDispatch.cs:66:29:66:29 | l : List<T> [element] : String | TypeFlowDispatch.cs:68:27:68:27 | access to parameter l : List<T> [element] : String |
| TypeFlowDispatch.cs:66:29:66:29 | l : List<T> [element] : String | TypeFlowDispatch.cs:68:27:68:27 | access to parameter l : List<T> [element] : String |
| TypeFlowDispatch.cs:68:22:68:22 | SSA def(x) : String | TypeFlowDispatch.cs:69:15:69:15 | access to local variable x : String |
| TypeFlowDispatch.cs:68:22:68:22 | SSA def(x) : String | TypeFlowDispatch.cs:69:15:69:15 | access to local variable x : String |
| TypeFlowDispatch.cs:68:27:68:27 | access to parameter l : List<T> [element] : String | TypeFlowDispatch.cs:68:22:68:22 | SSA def(x) : String |
| TypeFlowDispatch.cs:68:27:68:27 | access to parameter l : List<T> [element] : String | TypeFlowDispatch.cs:68:22:68:22 | SSA def(x) : String |
| TypeFlowDispatch.cs:69:15:69:15 | access to local variable x : String | TypeFlowDispatch.cs:57:32:57:32 | t : String |
| TypeFlowDispatch.cs:69:15:69:15 | access to local variable x : String | TypeFlowDispatch.cs:57:32:57:32 | t : String |
| TypeFlowDispatch.cs:69:15:69:15 | access to local variable x : String | TypeFlowDispatch.cs:58:32:58:32 | t : String |
| TypeFlowDispatch.cs:69:15:69:15 | access to local variable x : String | TypeFlowDispatch.cs:58:32:58:32 | t : String |
| TypeFlowDispatch.cs:72:33:72:33 | l : List<T> [element] : String | TypeFlowDispatch.cs:74:17:74:17 | access to parameter l : List<T> [element] : String |
| TypeFlowDispatch.cs:72:33:72:33 | l : List<T> [element] : String | TypeFlowDispatch.cs:74:17:74:17 | access to parameter l : List<T> [element] : String |
| TypeFlowDispatch.cs:74:17:74:17 | access to parameter l : List<T> [element] : String | TypeFlowDispatch.cs:66:29:66:29 | l : List<T> [element] : String |
| TypeFlowDispatch.cs:74:17:74:17 | access to parameter l : List<T> [element] : String | TypeFlowDispatch.cs:66:29:66:29 | l : List<T> [element] : String |
| TypeFlowDispatch.cs:79:23:79:54 | object creation of type List<String> : List<T> [element] : String | TypeFlowDispatch.cs:82:21:82:27 | access to local variable tainted : List<T> [element] : String |
| TypeFlowDispatch.cs:79:23:79:54 | object creation of type List<String> : List<T> [element] : String | TypeFlowDispatch.cs:82:21:82:27 | access to local variable tainted : List<T> [element] : String |
| TypeFlowDispatch.cs:79:42:79:52 | call to method Source<String> : String | TypeFlowDispatch.cs:79:23:79:54 | object creation of type List<String> : List<T> [element] : String |
| TypeFlowDispatch.cs:79:42:79:52 | call to method Source<String> : String | TypeFlowDispatch.cs:79:23:79:54 | object creation of type List<String> : List<T> [element] : String |
| TypeFlowDispatch.cs:82:21:82:27 | access to local variable tainted : List<T> [element] : String | TypeFlowDispatch.cs:72:33:72:33 | l : List<T> [element] : String |
| TypeFlowDispatch.cs:82:21:82:27 | access to local variable tainted : List<T> [element] : String | TypeFlowDispatch.cs:72:33:72:33 | l : List<T> [element] : String |
nodes
| TypeFlowDispatch.cs:16:42:16:42 | x : String | semmle.label | x : String |
| TypeFlowDispatch.cs:16:42:16:42 | x : String | semmle.label | x : String |
| TypeFlowDispatch.cs:18:11:18:11 | access to parameter x : String | semmle.label | access to parameter x : String |
| TypeFlowDispatch.cs:18:11:18:11 | access to parameter x : String | semmle.label | access to parameter x : String |
| TypeFlowDispatch.cs:21:46:21:46 | x : String | semmle.label | x : String |
| TypeFlowDispatch.cs:21:46:21:46 | x : String | semmle.label | x : String |
| TypeFlowDispatch.cs:23:19:23:19 | access to parameter x : String | semmle.label | access to parameter x : String |
| TypeFlowDispatch.cs:23:19:23:19 | access to parameter x : String | semmle.label | access to parameter x : String |
| TypeFlowDispatch.cs:28:20:28:20 | x : String | semmle.label | x : String |
| TypeFlowDispatch.cs:28:20:28:20 | x : String | semmle.label | x : String |
| TypeFlowDispatch.cs:28:32:28:32 | access to parameter x | semmle.label | access to parameter x |
| TypeFlowDispatch.cs:28:32:28:32 | access to parameter x | semmle.label | access to parameter x |
| TypeFlowDispatch.cs:28:39:28:49 | call to method Source<String> : String | semmle.label | call to method Source<String> : String |
| TypeFlowDispatch.cs:28:39:28:49 | call to method Source<String> : String | semmle.label | call to method Source<String> : String |
| TypeFlowDispatch.cs:29:20:29:20 | x : String | semmle.label | x : String |
| TypeFlowDispatch.cs:29:20:29:20 | x : String | semmle.label | x : String |
| TypeFlowDispatch.cs:29:32:29:32 | access to parameter x | semmle.label | access to parameter x |
| TypeFlowDispatch.cs:29:32:29:32 | access to parameter x | semmle.label | access to parameter x |
| TypeFlowDispatch.cs:30:30:30:40 | call to method Source<String> : String | semmle.label | call to method Source<String> : String |
| TypeFlowDispatch.cs:30:30:30:40 | call to method Source<String> : String | semmle.label | call to method Source<String> : String |
| TypeFlowDispatch.cs:34:37:34:37 | l : List<T> [element] : String | semmle.label | l : List<T> [element] : String |
| TypeFlowDispatch.cs:34:37:34:37 | l : List<T> [element] : String | semmle.label | l : List<T> [element] : String |
| TypeFlowDispatch.cs:36:9:36:9 | access to parameter l : List<T> [element] : String | semmle.label | access to parameter l : List<T> [element] : String |
| TypeFlowDispatch.cs:36:9:36:9 | access to parameter l : List<T> [element] : String | semmle.label | access to parameter l : List<T> [element] : String |
| TypeFlowDispatch.cs:41:23:41:54 | object creation of type List<String> : List<T> [element] : String | semmle.label | object creation of type List<String> : List<T> [element] : String |
| TypeFlowDispatch.cs:41:23:41:54 | object creation of type List<String> : List<T> [element] : String | semmle.label | object creation of type List<String> : List<T> [element] : String |
| TypeFlowDispatch.cs:41:42:41:52 | call to method Source<String> : String | semmle.label | call to method Source<String> : String |
| TypeFlowDispatch.cs:41:42:41:52 | call to method Source<String> : String | semmle.label | call to method Source<String> : String |
| TypeFlowDispatch.cs:43:31:43:31 | x : String | semmle.label | x : String |
| TypeFlowDispatch.cs:43:31:43:31 | x : String | semmle.label | x : String |
| TypeFlowDispatch.cs:43:43:43:43 | access to parameter x | semmle.label | access to parameter x |
| TypeFlowDispatch.cs:43:43:43:43 | access to parameter x | semmle.label | access to parameter x |
| TypeFlowDispatch.cs:44:25:44:31 | access to local variable tainted : List<T> [element] : String | semmle.label | access to local variable tainted : List<T> [element] : String |
| TypeFlowDispatch.cs:44:25:44:31 | access to local variable tainted : List<T> [element] : String | semmle.label | access to local variable tainted : List<T> [element] : String |
| TypeFlowDispatch.cs:44:34:44:34 | x : String | semmle.label | x : String |
| TypeFlowDispatch.cs:44:34:44:34 | x : String | semmle.label | x : String |
| TypeFlowDispatch.cs:44:46:44:46 | access to parameter x | semmle.label | access to parameter x |
| TypeFlowDispatch.cs:44:46:44:46 | access to parameter x | semmle.label | access to parameter x |
| TypeFlowDispatch.cs:47:42:47:42 | x : String | semmle.label | x : String |
| TypeFlowDispatch.cs:47:42:47:42 | x : String | semmle.label | x : String |
| TypeFlowDispatch.cs:49:11:49:11 | access to parameter x : String | semmle.label | access to parameter x : String |
| TypeFlowDispatch.cs:49:11:49:11 | access to parameter x : String | semmle.label | access to parameter x : String |
| TypeFlowDispatch.cs:52:46:52:46 | x : String | semmle.label | x : String |
| TypeFlowDispatch.cs:52:46:52:46 | x : String | semmle.label | x : String |
| TypeFlowDispatch.cs:54:19:54:19 | access to parameter x : String | semmle.label | access to parameter x : String |
| TypeFlowDispatch.cs:54:19:54:19 | access to parameter x : String | semmle.label | access to parameter x : String |
| TypeFlowDispatch.cs:57:32:57:32 | t : String | semmle.label | t : String |
| TypeFlowDispatch.cs:57:32:57:32 | t : String | semmle.label | t : String |
| TypeFlowDispatch.cs:57:43:57:43 | access to parameter t | semmle.label | access to parameter t |
| TypeFlowDispatch.cs:57:43:57:43 | access to parameter t | semmle.label | access to parameter t |
| TypeFlowDispatch.cs:58:32:58:32 | t : String | semmle.label | t : String |
| TypeFlowDispatch.cs:58:32:58:32 | t : String | semmle.label | t : String |
| TypeFlowDispatch.cs:58:43:58:43 | access to parameter t | semmle.label | access to parameter t |
| TypeFlowDispatch.cs:58:43:58:43 | access to parameter t | semmle.label | access to parameter t |
| TypeFlowDispatch.cs:62:38:62:48 | call to method Source<String> : String | semmle.label | call to method Source<String> : String |
| TypeFlowDispatch.cs:62:38:62:48 | call to method Source<String> : String | semmle.label | call to method Source<String> : String |
| TypeFlowDispatch.cs:66:29:66:29 | l : List<T> [element] : String | semmle.label | l : List<T> [element] : String |
| TypeFlowDispatch.cs:66:29:66:29 | l : List<T> [element] : String | semmle.label | l : List<T> [element] : String |
| TypeFlowDispatch.cs:68:22:68:22 | SSA def(x) : String | semmle.label | SSA def(x) : String |
| TypeFlowDispatch.cs:68:22:68:22 | SSA def(x) : String | semmle.label | SSA def(x) : String |
| TypeFlowDispatch.cs:68:27:68:27 | access to parameter l : List<T> [element] : String | semmle.label | access to parameter l : List<T> [element] : String |
| TypeFlowDispatch.cs:68:27:68:27 | access to parameter l : List<T> [element] : String | semmle.label | access to parameter l : List<T> [element] : String |
| TypeFlowDispatch.cs:69:15:69:15 | access to local variable x : String | semmle.label | access to local variable x : String |
| TypeFlowDispatch.cs:69:15:69:15 | access to local variable x : String | semmle.label | access to local variable x : String |
| TypeFlowDispatch.cs:72:33:72:33 | l : List<T> [element] : String | semmle.label | l : List<T> [element] : String |
| TypeFlowDispatch.cs:72:33:72:33 | l : List<T> [element] : String | semmle.label | l : List<T> [element] : String |
| TypeFlowDispatch.cs:74:17:74:17 | access to parameter l : List<T> [element] : String | semmle.label | access to parameter l : List<T> [element] : String |
| TypeFlowDispatch.cs:74:17:74:17 | access to parameter l : List<T> [element] : String | semmle.label | access to parameter l : List<T> [element] : String |
| TypeFlowDispatch.cs:79:23:79:54 | object creation of type List<String> : List<T> [element] : String | semmle.label | object creation of type List<String> : List<T> [element] : String |
| TypeFlowDispatch.cs:79:23:79:54 | object creation of type List<String> : List<T> [element] : String | semmle.label | object creation of type List<String> : List<T> [element] : String |
| TypeFlowDispatch.cs:79:42:79:52 | call to method Source<String> : String | semmle.label | call to method Source<String> : String |
| TypeFlowDispatch.cs:79:42:79:52 | call to method Source<String> : String | semmle.label | call to method Source<String> : String |
| TypeFlowDispatch.cs:82:21:82:27 | access to local variable tainted : List<T> [element] : String | semmle.label | access to local variable tainted : List<T> [element] : String |
| TypeFlowDispatch.cs:82:21:82:27 | access to local variable tainted : List<T> [element] : String | semmle.label | access to local variable tainted : List<T> [element] : String |
subpaths
#select
| TypeFlowDispatch.cs:28:32:28:32 | access to parameter x | TypeFlowDispatch.cs:28:39:28:49 | call to method Source<String> : String | TypeFlowDispatch.cs:28:32:28:32 | access to parameter x | $@ | TypeFlowDispatch.cs:28:39:28:49 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:28:32:28:32 | access to parameter x | TypeFlowDispatch.cs:28:39:28:49 | call to method Source<String> : String | TypeFlowDispatch.cs:28:32:28:32 | access to parameter x | $@ | TypeFlowDispatch.cs:28:39:28:49 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:28:32:28:32 | access to parameter x | TypeFlowDispatch.cs:30:30:30:40 | call to method Source<String> : String | TypeFlowDispatch.cs:28:32:28:32 | access to parameter x | $@ | TypeFlowDispatch.cs:30:30:30:40 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:28:32:28:32 | access to parameter x | TypeFlowDispatch.cs:30:30:30:40 | call to method Source<String> : String | TypeFlowDispatch.cs:28:32:28:32 | access to parameter x | $@ | TypeFlowDispatch.cs:30:30:30:40 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:29:32:29:32 | access to parameter x | TypeFlowDispatch.cs:28:39:28:49 | call to method Source<String> : String | TypeFlowDispatch.cs:29:32:29:32 | access to parameter x | $@ | TypeFlowDispatch.cs:28:39:28:49 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:29:32:29:32 | access to parameter x | TypeFlowDispatch.cs:28:39:28:49 | call to method Source<String> : String | TypeFlowDispatch.cs:29:32:29:32 | access to parameter x | $@ | TypeFlowDispatch.cs:28:39:28:49 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:29:32:29:32 | access to parameter x | TypeFlowDispatch.cs:30:30:30:40 | call to method Source<String> : String | TypeFlowDispatch.cs:29:32:29:32 | access to parameter x | $@ | TypeFlowDispatch.cs:30:30:30:40 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:29:32:29:32 | access to parameter x | TypeFlowDispatch.cs:30:30:30:40 | call to method Source<String> : String | TypeFlowDispatch.cs:29:32:29:32 | access to parameter x | $@ | TypeFlowDispatch.cs:30:30:30:40 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:43:43:43:43 | access to parameter x | TypeFlowDispatch.cs:41:42:41:52 | call to method Source<String> : String | TypeFlowDispatch.cs:43:43:43:43 | access to parameter x | $@ | TypeFlowDispatch.cs:41:42:41:52 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:43:43:43:43 | access to parameter x | TypeFlowDispatch.cs:41:42:41:52 | call to method Source<String> : String | TypeFlowDispatch.cs:43:43:43:43 | access to parameter x | $@ | TypeFlowDispatch.cs:41:42:41:52 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:44:46:44:46 | access to parameter x | TypeFlowDispatch.cs:41:42:41:52 | call to method Source<String> : String | TypeFlowDispatch.cs:44:46:44:46 | access to parameter x | $@ | TypeFlowDispatch.cs:41:42:41:52 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:44:46:44:46 | access to parameter x | TypeFlowDispatch.cs:41:42:41:52 | call to method Source<String> : String | TypeFlowDispatch.cs:44:46:44:46 | access to parameter x | $@ | TypeFlowDispatch.cs:41:42:41:52 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:57:43:57:43 | access to parameter t | TypeFlowDispatch.cs:62:38:62:48 | call to method Source<String> : String | TypeFlowDispatch.cs:57:43:57:43 | access to parameter t | $@ | TypeFlowDispatch.cs:62:38:62:48 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:57:43:57:43 | access to parameter t | TypeFlowDispatch.cs:62:38:62:48 | call to method Source<String> : String | TypeFlowDispatch.cs:57:43:57:43 | access to parameter t | $@ | TypeFlowDispatch.cs:62:38:62:48 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:57:43:57:43 | access to parameter t | TypeFlowDispatch.cs:79:42:79:52 | call to method Source<String> : String | TypeFlowDispatch.cs:57:43:57:43 | access to parameter t | $@ | TypeFlowDispatch.cs:79:42:79:52 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:57:43:57:43 | access to parameter t | TypeFlowDispatch.cs:79:42:79:52 | call to method Source<String> : String | TypeFlowDispatch.cs:57:43:57:43 | access to parameter t | $@ | TypeFlowDispatch.cs:79:42:79:52 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:58:43:58:43 | access to parameter t | TypeFlowDispatch.cs:62:38:62:48 | call to method Source<String> : String | TypeFlowDispatch.cs:58:43:58:43 | access to parameter t | $@ | TypeFlowDispatch.cs:62:38:62:48 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:58:43:58:43 | access to parameter t | TypeFlowDispatch.cs:62:38:62:48 | call to method Source<String> : String | TypeFlowDispatch.cs:58:43:58:43 | access to parameter t | $@ | TypeFlowDispatch.cs:62:38:62:48 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:58:43:58:43 | access to parameter t | TypeFlowDispatch.cs:79:42:79:52 | call to method Source<String> : String | TypeFlowDispatch.cs:58:43:58:43 | access to parameter t | $@ | TypeFlowDispatch.cs:79:42:79:52 | call to method Source<String> : String | call to method Source<String> : String |
| TypeFlowDispatch.cs:58:43:58:43 | access to parameter t | TypeFlowDispatch.cs:79:42:79:52 | call to method Source<String> : String | TypeFlowDispatch.cs:58:43:58:43 | access to parameter t | $@ | TypeFlowDispatch.cs:79:42:79:52 | call to method Source<String> : String | call to method Source<String> : String |

View File

@@ -0,0 +1,12 @@
/**
* @kind path-problem
*/
import csharp
import TestUtilities.InlineFlowTest
import DefaultFlowTest
import PathGraph
from PathNode source, PathNode sink
where flowPath(source, sink)
select sink, source, sink, "$@", source, source.toString()

View File

@@ -0,0 +1,2 @@
semmle-extractor-options: /nostdlib /noconfig
semmle-extractor-options: --load-sources-from-project:${testdir}/../../../resources/stubs/_frameworks/Microsoft.NETCore.App/Microsoft.NETCore.App.csproj