@@ -39,9 +39,12 @@ Callable viableCallable(Call c) {
3939 c instanceof ConstructorCall and result = c .getCallee ( ) .getSourceDeclaration ( )
4040}
4141
42- /** A method that is the target of a call. */
43- class CalledMethod extends Method {
44- CalledMethod ( ) { exists ( MethodAccess ma | ma .getMethod ( ) = this ) }
42+ /** The source declaration of a method that is the target of a virtual call. */
43+ class VirtCalledSrcMethod extends SrcMethod {
44+ pragma [ nomagic]
45+ VirtCalledSrcMethod ( ) {
46+ exists ( VirtualMethodAccess ma | ma .getMethod ( ) .getSourceDeclaration ( ) = this )
47+ }
4548}
4649
4750cached
@@ -73,7 +76,7 @@ private module Dispatch {
7376 (
7477 exists ( Method def , RefType t , boolean exact |
7578 qualType ( ma , t , exact ) and
76- def = ma .getMethod ( )
79+ def = ma .getMethod ( ) . getSourceDeclaration ( )
7780 |
7881 exact = true and result = exactMethodImpl ( def , t .getSourceDeclaration ( ) )
7982 or
@@ -185,8 +188,8 @@ private module Dispatch {
185188 not result .isAbstract ( ) and
186189 if source instanceof VirtualMethodAccess
187190 then
188- exists ( CalledMethod def , RefType t , boolean exact |
189- source .getMethod ( ) = def and
191+ exists ( VirtCalledSrcMethod def , RefType t , boolean exact |
192+ source .getMethod ( ) . getSourceDeclaration ( ) = def and
190193 hasQualifierType ( source , t , exact )
191194 |
192195 exact = true and result = exactMethodImpl ( def , t .getSourceDeclaration ( ) )
@@ -301,14 +304,14 @@ private module Dispatch {
301304
302305 /** Gets the implementation of `top` present on a value of precisely type `t`. */
303306 cached
304- Method exactMethodImpl ( CalledMethod top , SrcRefType t ) {
307+ Method exactMethodImpl ( VirtCalledSrcMethod top , SrcRefType t ) {
305308 hasSrcMethod ( t , result ) and
306- top .getAPossibleImplementation ( ) = result
309+ top .getAPossibleImplementationOfSrcMethod ( ) = result
307310 }
308311
309312 /** Gets the implementations of `top` present on viable subtypes of `t`. */
310313 cached
311- Method viableMethodImpl ( CalledMethod top , SrcRefType tsrc , RefType t ) {
314+ Method viableMethodImpl ( VirtCalledSrcMethod top , SrcRefType tsrc , RefType t ) {
312315 exists ( SrcRefType sub |
313316 result = exactMethodImpl ( top , sub ) and
314317 tsrc = t .getSourceDeclaration ( ) and
0 commit comments