@@ -1127,7 +1127,21 @@ class DataFlowCall extends TDataFlowCall {
1127
1127
/**
1128
1128
* Gets the `Function` that the call targets, if this is statically known.
1129
1129
*/
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
+ }
1131
1145
1132
1146
/**
1133
1147
* Gets the `index`'th argument operand. The qualifier is considered to have index `-1`.
@@ -1173,14 +1187,12 @@ private class NormalCall extends DataFlowCall, TNormalCall {
1173
1187
1174
1188
override CallTargetOperand getCallTargetOperand ( ) { result = call .getCallTargetOperand ( ) }
1175
1189
1176
- override DataFlowCallable getStaticCallTarget ( ) {
1177
- result .getUnderlyingCallable ( ) = call .getStaticCallTarget ( )
1178
- }
1190
+ override Function getStaticCallSourceTarget ( ) { result = call .getStaticCallTarget ( ) }
1179
1191
1180
1192
override ArgumentOperand getArgumentOperand ( int index ) { result = call .getArgumentOperand ( index ) }
1181
1193
1182
1194
override DataFlowCallable getEnclosingCallable ( ) {
1183
- result .getUnderlyingCallable ( ) = call .getEnclosingFunction ( )
1195
+ result .asSourceCallable ( ) = call .getEnclosingFunction ( )
1184
1196
}
1185
1197
1186
1198
override string toString ( ) { result = call .toString ( ) }
0 commit comments