C#: Reduce the amount of trash flow summaries produced for StringValues.

This commit is contained in:
Michael Nebel
2021-12-21 16:13:24 +01:00
parent 9a355c1050
commit c36bf3cebc

View File

@@ -525,10 +525,14 @@ class StringValuesFlow extends LibraryTypeDataFlow, Struct {
) {
c.getDeclaringType() = this and
(
source instanceof CallableFlowSourceArg or
source instanceof CallableFlowSourceQualifier
exists(Parameter p, int i |
p = c.getParameter(i) and
source = TCallableFlowSourceArg(i)
)
or
not c.(Method).isStatic() and source = TCallableFlowSourceQualifier()
) and
sink instanceof CallableFlowSinkReturn and
sink = TCallableFlowSinkReturn() and
preservesValue = false
}
}