Skip to content

Commit 4905612

Browse files
authored
Merge pull request github#16573 from aschackmull/java/dispatch-joinorder
Java: Fix join-order in viableImplInCallContext.
2 parents 619913b + 4b3e35e commit 4905612

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,18 @@ private module DispatchImpl {
136136
mayBenefitFromCallContext(call.asCall(), _, _)
137137
}
138138

139+
bindingset[call, tgt]
140+
pragma[inline_late]
141+
private predicate viableCallableFilter(DataFlowCall call, DataFlowCallable tgt) {
142+
tgt = viableCallable(call)
143+
}
144+
139145
/**
140146
* Gets a viable dispatch target of `call` in the context `ctx`. This is
141147
* restricted to those `call`s for which a context might make a difference.
142148
*/
143149
DataFlowCallable viableImplInCallContext(DataFlowCall call, DataFlowCall ctx) {
144-
result = viableCallable(call) and
150+
viableCallableFilter(call, result) and
145151
exists(int i, Callable c, Method def, RefType t, boolean exact, MethodCall ma |
146152
ma = call.asCall() and
147153
mayBenefitFromCallContext(ma, c, i) and

0 commit comments

Comments
 (0)