зеркало из https://github.com/github/codeql.git
C#: Convert System.Runtime.CompilerServices.ConfiguredTaskAwaitable<>.ConfiguredTaskAwaiter flow to CSV format.
This commit is contained in:
Родитель
ddb7d722bc
Коммит
a5c055581e
|
@ -1391,34 +1391,6 @@ private class SyntheticConfiguredTaskAwaiterField extends SyntheticField {
|
|||
}
|
||||
}
|
||||
|
||||
/** Data flow for `System.Runtime.CompilerServices.ConfiguredTaskAwaitable<>.ConfiguredTaskAwaiter`. */
|
||||
class SystemRuntimeCompilerServicesConfiguredTaskAwaitableTConfiguredTaskAwaiterFlow extends LibraryTypeDataFlow,
|
||||
SystemRuntimeCompilerServicesConfiguredTaskAwaitableTConfiguredTaskAwaiterStruct {
|
||||
override predicate callableFlow(
|
||||
CallableFlowSource source, AccessPath sourceAp, CallableFlowSink sink, AccessPath sinkAp,
|
||||
SourceDeclarationCallable c, boolean preservesValue
|
||||
) {
|
||||
// var awaitable = task.ConfigureAwait(false);
|
||||
// var awaiter = awaitable.GetAwaiter();
|
||||
// var result = awaiter.GetResult(); // <-- task.Result
|
||||
preservesValue = true and
|
||||
c = this.getGetResultMethod() and
|
||||
source = TCallableFlowSourceQualifier() and
|
||||
sourceAp =
|
||||
AccessPath::cons(any(SyntheticFieldContent sfc |
|
||||
sfc.getField() instanceof SyntheticConfiguredTaskAwaitableUnderlyingTaskField
|
||||
), AccessPath::property(any(SystemThreadingTasksTaskTClass t).getResultProperty())) and
|
||||
sink = TCallableFlowSinkReturn() and
|
||||
sinkAp = AccessPath::empty()
|
||||
}
|
||||
|
||||
override predicate requiresAccessPath(Content head, AccessPath tail) {
|
||||
head.(SyntheticFieldContent).getField() instanceof
|
||||
SyntheticConfiguredTaskAwaitableUnderlyingTaskField and
|
||||
tail = AccessPath::property(any(SystemThreadingTasksTaskTClass t).getResultProperty())
|
||||
}
|
||||
}
|
||||
|
||||
/** Data flow for `System.Text.Encoding`. */
|
||||
library class SystemTextEncodingFlow extends LibraryTypeDataFlow, SystemTextEncodingClass {
|
||||
override predicate callableFlow(
|
||||
|
|
|
@ -73,3 +73,11 @@ class SystemRuntimeCompilerServicesConfiguredTaskAwaitableTConfiguredTaskAwaiter
|
|||
/** Gets the field that stores the underlying task. */
|
||||
Field getUnderlyingTaskField() { result = this.getAField() and result.hasName("m_task") }
|
||||
}
|
||||
|
||||
/** Data flow for `System.Runtime.CompilerServices.ConfiguredTaskAwaitable<>.ConfiguredTaskAwaiter`. */
|
||||
private class SystemRuntimeCompilerServicesConfiguredTaskAwaitableTConfiguredTaskAwaiterFlowModelCsv extends SummaryModelCsv {
|
||||
override predicate row(string row) {
|
||||
row =
|
||||
"System.Runtime.CompilerServices;ConfiguredTaskAwaitable<>+ConfiguredTaskAwaiter;false;GetResult;();;Property[System.Threading.Tasks.Task<>.Result] of SyntheticField[m_task_configured_task_awaitable] of Argument[-1];ReturnValue;value"
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче