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

Member predicate Ssa::ExplicitDefinition::isCapturedVariableDefinitionFlowOut

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


class C {
  void M1() {
    int i = 0;
    void M2() { i = 2; };

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

predicate isCapturedVariableDefinitionFlowOut(ImplicitCallDefinition cdef, boolean additionalCalls)