Skip to content

Commit 3eb3cd3

Browse files
committed
Java: Update qldoc and add callsImpl convenience wrapper.
1 parent f9e4512 commit 3eb3cd3

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

java/ql/src/semmle/code/java/Member.qll

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,21 @@ class Callable extends StmtParent, Member, @callable {
117117
/**
118118
* Holds if this callable may call the specified callable,
119119
* taking virtual dispatch into account.
120+
*
121+
* This includes both static call targets and dynamic dispatch targets.
120122
*/
121123
predicate polyCalls(Callable m) {
122-
this.calls(m)
123-
or
124+
this.calls(m) or this.callsImpl(m)
125+
}
126+
127+
/**
128+
* Holds if `c` is a viable implementation of a callable called by this
129+
* callable, taking virtual dispatch resolution into account.
130+
*/
131+
predicate callsImpl(Callable c) {
124132
exists(Call call |
125133
call.getCaller() = this and
126-
viableCallable(call) = m
134+
viableCallable(call) = c
127135
)
128136
}
129137

0 commit comments

Comments
 (0)