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

Member predicate Ssa::Definition::getARead

Gets a read of the source variable underlying this SSA definition that can be reached from this SSA definition without passing through any other SSA definitions. Example:

int Field;

void SetField(int i) {
  this.Field = i;
  Use(this.Field);
  if (i > 0)
    this.Field = i - 1;
  else if (i < 0)
    SetField(1);
  Use(this.Field);
  Use(this.Field);
}
  • The reads of i on lines 4, 6, 7, and 8 can be reached from the explicit SSA definition (wrapping an implicit entry definition) on line 3.
  • The read of this.Field on line 5 can be reached from the explicit SSA definition on line 4.
  • The reads of this.Field on lines 10 and 11 can be reached from the phi node between lines 9 and 10.
AssignableRead getARead()