Java: Always apply heuristic query regardless of existing models.

This commit is contained in:
Anders Schack-Mulligen 2023-08-08 10:01:43 +02:00
Родитель cd22bb3505
Коммит ab334f6c1b
1 изменённых файлов: 1 добавлений и 8 удалений

Просмотреть файл

@ -62,16 +62,9 @@ Method getRunnerTarget(MethodAccess ma) {
import semmle.code.java.dataflow.FlowSummary
import semmle.code.java.dataflow.internal.FlowSummaryImplSpecific as ImplSpecific
private predicate hasExternalSummary(Callable c) {
exists(SummarizedCallableBase scb | scb.asCallable() = c |
ImplSpecific::summaryElement(scb, _, _, _, _)
)
}
private predicate mayInvokeCallback(SrcMethod m, int n) {
m.getParameterType(n).(RefType).getSourceDeclaration() instanceof FunctionalInterface and
(not m.fromSource() or m.isNative() or m.getFile().getAbsolutePath().matches("%/test/stubs/%")) and
not hasExternalSummary(m)
(not m.fromSource() or m.isNative() or m.getFile().getAbsolutePath().matches("%/test/stubs/%"))
}
private class SummarizedCallableWithCallback extends SummarizedCallable {