diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll index dc58529ed26..a27f14cede0 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll @@ -60,7 +60,7 @@ private module DispatchImpl { not ( // Only use summarized callables with generated summaries in case // the static call target is not in the source code. - // Note that if applyGeneratedModel holds it implies that there doesn't + // Note that if `applyGeneratedModel` holds it implies that there doesn't // exist a manual model. exists(Callable staticTarget | staticTarget = call.getCallee().getSourceDeclaration() | staticTarget.fromSource() and not staticTarget.isStub() diff --git a/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll b/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll index 393095e80d9..fc84c8f0bc6 100644 --- a/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll +++ b/rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll @@ -445,7 +445,15 @@ module RustDataFlow implements InputSig { or exists(SummarizedCallable sc, Function staticTarget | staticTarget = getStaticTargetExt(c) and - sc = result.asSummarizedCallable() + sc = result.asSummarizedCallable() and + // Only use summarized callables with generated summaries in case + // the static call target is not in the source code. + // Note that if `applyGeneratedModel` holds it implies that there doesn't + // exist a manual model. + not ( + staticTarget.fromSource() and + sc.applyGeneratedModel() + ) | sc = staticTarget or