-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C#: Move async data-flow tests from local to global #3798
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
using System.Text; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
/// <summary> | ||
/// All (tainted) sinks are named `sink[Param|Field|Property]N`, for some N, and all | ||
|
@@ -231,6 +232,21 @@ public void M2() | |
Check(nonSink); | ||
} | ||
|
||
public async void M3() | ||
{ | ||
// async await, tainted | ||
var sink41 = Task.Run(() => "taint source"); | ||
Check(sink41); | ||
var sink42 = await sink41; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rename to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, okay! |
||
Check(sink42); | ||
|
||
// async await, not tainted | ||
var nonSink0 = Task.Run(() => ""); | ||
Check(nonSink0); | ||
var nonSink1 = await nonSink0; | ||
Check(nonSink1); | ||
} | ||
|
||
static void Check<T>(T x) { } | ||
|
||
static void In0<T>(T sinkParam0) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename to
sink0
?