@@ -1127,7 +1127,21 @@ class DataFlowCall extends TDataFlowCall {
11271127 /**
11281128 * Gets the `Function` that the call targets, if this is statically known.
11291129 */
1130- DataFlowCallable getStaticCallTarget ( ) { none ( ) }
1130+ Function getStaticCallSourceTarget ( ) { none ( ) }
1131+
1132+ /**
1133+ * Gets the target of this call. If a summarized callable exists for the
1134+ * target this is chosen, and otherwise the callable is the implementation
1135+ * from the source code.
1136+ */
1137+ DataFlowCallable getStaticCallTarget ( ) {
1138+ exists ( Function target | target = this .getStaticCallSourceTarget ( ) |
1139+ not exists ( TSummarizedCallable ( target ) ) and
1140+ result .asSourceCallable ( ) = target
1141+ or
1142+ result .asSummarizedCallable ( ) = target
1143+ )
1144+ }
11311145
11321146 /**
11331147 * Gets the `index`'th argument operand. The qualifier is considered to have index `-1`.
@@ -1173,14 +1187,12 @@ private class NormalCall extends DataFlowCall, TNormalCall {
11731187
11741188 override CallTargetOperand getCallTargetOperand ( ) { result = call .getCallTargetOperand ( ) }
11751189
1176- override DataFlowCallable getStaticCallTarget ( ) {
1177- result .getUnderlyingCallable ( ) = call .getStaticCallTarget ( )
1178- }
1190+ override Function getStaticCallSourceTarget ( ) { result = call .getStaticCallTarget ( ) }
11791191
11801192 override ArgumentOperand getArgumentOperand ( int index ) { result = call .getArgumentOperand ( index ) }
11811193
11821194 override DataFlowCallable getEnclosingCallable ( ) {
1183- result .getUnderlyingCallable ( ) = call .getEnclosingFunction ( )
1195+ result .asSourceCallable ( ) = call .getEnclosingFunction ( )
11841196 }
11851197
11861198 override string toString ( ) { result = call .toString ( ) }
0 commit comments