mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
C#: Convert System.Runtime.CompilerServices.TaskAwaiter<> flow to CSV format.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user