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

Member predicate AssignableDefinition::getAFirstRead

Gets a first read of the same underlying assignable. That is, a read that can be reached from this definition without passing through any other reads, and which is guaranteed to read the value assigned in this definition. Example:

int Field;

void SetField(int i) {
  this.Field = i;
  if (i > 0)
    this.Field = i - 1;
  else if (i < 0)
  • The read of i on line 4 is first read of the implicit parameter definition on line 3.
  • The read of this.Field on line 5 is a first read of the definition on line 4.

Subsequent reads can be found by following the steps defined by AssignableRead.getANextRead().

AssignableRead getAFirstRead()