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

Member predicate AbstractValue::isReferentialProperty

Holds if this value describes a referential property. For example, emptiness of a collection is a referential property.

Such values only propagate through adjacent reads, for example, in

int M()
{
    var x = new string[]{ "a", "b", "c" }.ToList();
    x.Clear();
    return x.Count;
}

the non-emptiness of new string[]{ "a", "b", "c" }.ToList() only propagates to the read of x in x.Clear() and not in x.Count.

Aliasing is not taken into account in the analyses.

predicate isReferentialProperty()