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

Member predicate Ssa::Definition::getALastReadAtNode

Gets a last read of the source variable underlying this SSA definition at control flow node cfn. That is, a read that can reach the end of the enclosing callable, or another SSA definition for the source variable, without passing through any other read. Example:

int Field;

void SetField(int i) {
  this.Field = i;
  if (i > 0)
    this.Field = i - 1;
  else if (i < 0)
  • The reads of i on lines 7 and 8 are the last reads for the implicit parameter definition on line 3.
  • The read of this.Field on line 5 is a last read of the definition on line 4.
  • The read of this.Field on line 11 is a last read of the phi node between lines 9 and 10.
AssignableRead getALastReadAtNode(Node cfn)