C#: Avoid generating new source models on 'file' kind sources.

This commit is contained in:
Michael Nebel
2022-08-25 15:19:05 +02:00
parent a83ab79d31
commit be4c2231d1
4 changed files with 14 additions and 0 deletions

View File

@@ -234,6 +234,7 @@ string captureSource(TargetApi api) {
config.hasFlow(source, sink) and
ExternalFlow::sourceNode(source, kind) and
api = sink.getEnclosingCallable() and
isRelevantSourceKind(kind) and
result = asSourceModel(api, returnNodeAsOutput(sink), kind)
)
}

View File

@@ -259,3 +259,9 @@ predicate isRelevantSinkKind(string kind) {
not kind.matches("regex-use%") and
not kind = "write-file"
}
/**
* Holds if `kind` is a relevant source kind for creating source models.
*/
bindingset[kind]
predicate isRelevantSourceKind(string kind) { any() }