Skip to content

Commit c36bf3c

Browse files
committed
C#: Reduce the amount of trash flow summaries produced for StringValues.
1 parent 9a355c1 commit c36bf3c

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/LibraryTypeDataFlow.qll

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,10 +525,14 @@ class StringValuesFlow extends LibraryTypeDataFlow, Struct {
525525
) {
526526
c.getDeclaringType() = this and
527527
(
528-
source instanceof CallableFlowSourceArg or
529-
source instanceof CallableFlowSourceQualifier
528+
exists(Parameter p, int i |
529+
p = c.getParameter(i) and
530+
source = TCallableFlowSourceArg(i)
531+
)
532+
or
533+
not c.(Method).isStatic() and source = TCallableFlowSourceQualifier()
530534
) and
531-
sink instanceof CallableFlowSinkReturn and
535+
sink = TCallableFlowSinkReturn() and
532536
preservesValue = false
533537
}
534538
}

0 commit comments

Comments
 (0)