C#: Convert System.Runtime.CompilerServices.TaskAwaiter<> flow to CSV format.

This commit is contained in:
Michael Nebel
2021-12-15 09:48:59 +01:00
parent bdd44c1c46
commit ddb7d722bc
2 changed files with 7 additions and 24 deletions

View File

@@ -1391,30 +1391,6 @@ private class SyntheticConfiguredTaskAwaiterField extends SyntheticField {
}
}
/** Data flow for `System.Runtime.CompilerServices.TaskAwaiter<>`. */
class SystemRuntimeCompilerServicesTaskAwaiterFlow extends LibraryTypeDataFlow,
SystemRuntimeCompilerServicesTaskAwaiterStruct {
override predicate callableFlow(
CallableFlowSource source, AccessPath sourceAp, CallableFlowSink sink, AccessPath sinkAp,
SourceDeclarationCallable c, boolean preservesValue
) {
preservesValue = true and
c = this.getGetResultMethod() and
source = TCallableFlowSourceQualifier() and
sourceAp =
AccessPath::cons(any(SyntheticFieldContent sfc |
sfc.getField() instanceof SyntheticTaskAwaiterUnderlyingTaskField
), AccessPath::property(any(SystemThreadingTasksTaskTClass t).getResultProperty())) and
sink = TCallableFlowSinkReturn() and
sinkAp = AccessPath::empty()
}
override predicate requiresAccessPath(Content head, AccessPath tail) {
head.(SyntheticFieldContent).getField() instanceof SyntheticTaskAwaiterUnderlyingTaskField and
tail = AccessPath::property(any(SystemThreadingTasksTaskTClass t).getResultProperty())
}
}
/** Data flow for `System.Runtime.CompilerServices.ConfiguredTaskAwaitable<>.ConfiguredTaskAwaiter`. */
class SystemRuntimeCompilerServicesConfiguredTaskAwaitableTConfiguredTaskAwaiterFlow extends LibraryTypeDataFlow,
SystemRuntimeCompilerServicesConfiguredTaskAwaitableTConfiguredTaskAwaiterStruct {

View File

@@ -30,6 +30,13 @@ class SystemRuntimeCompilerServicesTaskAwaiterStruct extends SystemRuntimeCompil
Field getUnderlyingTaskField() { result = this.getAField() and result.hasName("m_task") }
}
private class SystemRuntimeCompilerServicesTaskAwaiterFlowModelCsv extends SummaryModelCsv {
override predicate row(string row) {
row =
"System.Runtime.CompilerServices;TaskAwaiter<>;false;GetResult;();;Property[System.Threading.Tasks.Task<>.Result] of SyntheticField[m_task_task_awaiter] of Argument[-1];ReturnValue;value"
}
}
/** The `System.Runtime.CompilerServices.ConfiguredTaskAwaitable<>` struct. */
class SystemRuntimeCompilerServicesConfiguredTaskAwaitableTStruct extends SystemRuntimeCompilerServicesNamespaceUnboundGenericStruct {
SystemRuntimeCompilerServicesConfiguredTaskAwaitableTStruct() {