CodeQL library for C#
codeql/csharp-all 0.4.0-dev (changelog, source)

Member predicate Ssa::ExplicitDefinition::isCapturedVariableDefinitionFlowIn

Holds if this definition updates a captured local scope variable, and the updated value may be read from the implicit entry definition def using one or more calls (as indicated by additionalCalls), starting from call c.


class C {
  void M1() {
    int i = 0;
    void M2() => System.Console.WriteLine(i);
    i = 1;

If this definition is the update of i on line 5, then the value may be read inside M2 via the call on line 6.

predicate isCapturedVariableDefinitionFlowIn(ImplicitEntryDefinition def, ElementNode c, boolean additionalCalls)