C#/Java: Materialize sink/source/summary predicates to avoid join on input/output before filtering.

This commit is contained in:
Michael Nebel
2023-02-07 10:56:12 +01:00
parent 6e9484970f
commit f8dbbe006e
2 changed files with 6 additions and 0 deletions

View File

@@ -74,16 +74,19 @@ class ExternalApi extends Callable {
}
/** Holds if this API has a supported summary. */
pragma[nomagic]
predicate hasSummary() {
this = any(SummarizedCallable sc).asCallable() or
TaintTracking::localAdditionalTaintStep(this.getAnInput(), _)
}
pragma[nomagic]
predicate isSource() {
this.getAnOutput() instanceof RemoteFlowSource or sourceNode(this.getAnOutput(), _)
}
/** Holds if this API is a known sink. */
pragma[nomagic]
predicate isSink() { sinkNode(this.getAnInput(), _) }
/** Holds if this API is supported by existing CodeQL libraries, that is, it is either a recognized source or sink or has a flow summary. */