Skip to content

Commit 7819c88

Browse files
committed
Merge remote-tracking branch 'origin/main' into redsun82/update-kotlin-2.3.20
2 parents ad32ed4 + 8fc914f commit 7819c88

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ bazel_dep(name = "rules_java", version = "9.6.1")
2121
bazel_dep(name = "rules_pkg", version = "1.2.0")
2222
bazel_dep(name = "rules_nodejs", version = "6.7.3")
2323
bazel_dep(name = "rules_python", version = "1.9.0")
24-
bazel_dep(name = "rules_shell", version = "0.6.1")
24+
bazel_dep(name = "rules_shell", version = "0.7.1")
2525
bazel_dep(name = "bazel_skylib", version = "1.9.0")
2626
bazel_dep(name = "abseil-cpp", version = "20260107.1", repo_name = "absl")
2727
bazel_dep(name = "nlohmann_json", version = "3.11.3", repo_name = "json")

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowDispatch.qll

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,12 @@ private module TrackVirtualDispatch<methodDispatchSig/1 virtualDispatch0> {
238238

239239
private import TypeTracking<Location, TtInput>::TypeTrack<qualifierSource/1>::Graph<qualifierOfVirtualCall/1>
240240

241-
private predicate edgePlus(PathNode n1, PathNode n2) = fastTC(edges/2)(n1, n2)
241+
private predicate isSource(PathNode n) { n.isSource() }
242+
243+
private predicate isSink(PathNode n) { n.isSink() }
244+
245+
private predicate edgePlus(PathNode n1, PathNode n2) =
246+
doublyBoundedFastTC(edges/2, isSource/1, isSink/1)(n1, n2)
242247

243248
/**
244249
* Gets the most specific implementation of `mf` that may be called when the
@@ -255,6 +260,15 @@ private module TrackVirtualDispatch<methodDispatchSig/1 virtualDispatch0> {
255260
)
256261
}
257262

263+
pragma[nomagic]
264+
private MemberFunction mostSpecificForSource(PathNode p1, MemberFunction mf) {
265+
p1.isSource() and
266+
exists(Class derived |
267+
qualifierSourceImpl(p1.getNode(), derived) and
268+
result = mostSpecific(mf, derived)
269+
)
270+
}
271+
258272
/**
259273
* Gets a possible pair of end-points `(p1, p2)` where:
260274
* - `p1` is a derived-to-base conversion that converts from some
@@ -264,16 +278,16 @@ private module TrackVirtualDispatch<methodDispatchSig/1 virtualDispatch0> {
264278
* - `callable` is the most specific implementation that may be called when
265279
* the qualifier has type `derived`.
266280
*/
281+
bindingset[p1, p2]
282+
pragma[inline_late]
267283
private predicate pairCand(
268284
PathNode p1, PathNode p2, DataFlowPrivate::DataFlowCallable callable,
269285
DataFlowPrivate::DataFlowCall call
270286
) {
271-
exists(Class derived, MemberFunction mf |
272-
qualifierSourceImpl(p1.getNode(), derived) and
287+
p2.isSink() and
288+
exists(MemberFunction mf |
273289
qualifierOfVirtualCallImpl(p2.getNode(), call.asCallInstruction(), mf) and
274-
p1.isSource() and
275-
p2.isSink() and
276-
callable.asSourceCallable() = mostSpecific(mf, derived)
290+
callable.asSourceCallable() = mostSpecificForSource(p1, mf)
277291
)
278292
}
279293

0 commit comments

Comments
 (0)