Skip to content

Commit effca44

Browse files
committed
Java: Fix a bug in call-context-sensitve dispatch to SummarizedCallable.
1 parent ef9d096 commit effca44

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private module DispatchImpl {
101101
* restricted to those `ma`s for which a context might make a difference.
102102
*/
103103
Method viableImplInCallContext(MethodAccess ma, Call ctx) {
104-
result = VirtualDispatch::viableImpl(ma) and
104+
result = viableCallable(ma) and
105105
exists(int i, Callable c, Method def, RefType t, boolean exact |
106106
mayBenefitFromCallContext(ma, c, i) and
107107
c = viableCallable(ctx) and
@@ -115,6 +115,8 @@ private module DispatchImpl {
115115
result = VirtualDispatch::viableMethodImpl(def, t.getSourceDeclaration(), t2) and
116116
not failsUnification(t, t2)
117117
)
118+
or
119+
result = def and def instanceof SummarizedCallable
118120
)
119121
}
120122

0 commit comments

Comments
 (0)