Skip to content

Commit 0b81d44

Browse files
committed
Rust: Apply same filtering of generated summaries as in C# and Java
1 parent c4a8e9d commit 0b81d44

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

java/ql/lib/semmle/code/java/dataflow/internal/DataFlowDispatch.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private module DispatchImpl {
6060
not (
6161
// Only use summarized callables with generated summaries in case
6262
// the static call target is not in the source code.
63-
// Note that if applyGeneratedModel holds it implies that there doesn't
63+
// Note that if `applyGeneratedModel` holds it implies that there doesn't
6464
// exist a manual model.
6565
exists(Callable staticTarget | staticTarget = call.getCallee().getSourceDeclaration() |
6666
staticTarget.fromSource() and not staticTarget.isStub()

rust/ql/lib/codeql/rust/dataflow/internal/DataFlowImpl.qll

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,15 @@ module RustDataFlow implements InputSig<Location> {
445445
or
446446
exists(SummarizedCallable sc, Function staticTarget |
447447
staticTarget = getStaticTargetExt(c) and
448-
sc = result.asSummarizedCallable()
448+
sc = result.asSummarizedCallable() and
449+
// Only use summarized callables with generated summaries in case
450+
// the static call target is not in the source code.
451+
// Note that if `applyGeneratedModel` holds it implies that there doesn't
452+
// exist a manual model.
453+
not (
454+
staticTarget.fromSource() and
455+
sc.applyGeneratedModel()
456+
)
449457
|
450458
sc = staticTarget
451459
or

0 commit comments

Comments
 (0)