Skip to content

Commit 4b3e35e

Browse files
committed
Java: Fix join-order in viableImplInCallContext.
1 parent 5cf7112 commit 4b3e35e

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
@@ -122,12 +122,18 @@ private module DispatchImpl {
122122
mayBenefitFromCallContext(call.asCall(), _, _)
123123
}
124124

125+
bindingset[call, tgt]
126+
pragma[inline_late]
127+
private predicate viableCallableFilter(DataFlowCall call, DataFlowCallable tgt) {
128+
tgt = viableCallable(call)
129+
}
130+
125131
/**
126132
* Gets a viable dispatch target of `call` in the context `ctx`. This is
127133
* restricted to those `call`s for which a context might make a difference.
128134
*/
129135
DataFlowCallable viableImplInCallContext(DataFlowCall call, DataFlowCall ctx) {
130-
result = viableCallable(call) and
136+
viableCallableFilter(call, result) and
131137
exists(int i, Callable c, Method def, RefType t, boolean exact, MethodCall ma |
132138
ma = call.asCall() and
133139
mayBenefitFromCallContext(ma, c, i) and

0 commit comments

Comments
 (0)