@@ -105,7 +105,7 @@ private predicate ignoreConstructor(Expr e) {
105
105
* constructs an object containing at least one virtual function.
106
106
* - a node which represents a derived-to-base instruction that converts from `c`.
107
107
*/
108
- private predicate lambdaSourceImpl ( RelevantNode n , Class c ) {
108
+ private predicate qualifierSourceImpl ( RelevantNode n , Class c ) {
109
109
// Object construction
110
110
exists ( CallInstruction call , ThisArgumentOperand qualifier , Call e |
111
111
qualifier = call .getThisArgumentOperand ( ) and
@@ -131,14 +131,14 @@ private predicate lambdaSourceImpl(RelevantNode n, Class c) {
131
131
)
132
132
}
133
133
134
- private module TrackVirtualDispatch< methodDispatchSig / 1 lambdaDispatch0 > {
134
+ private module TrackVirtualDispatch< methodDispatchSig / 1 virtualDispatch0 > {
135
135
/**
136
136
* Gets a possible runtime target of `c` using both static call-target
137
- * information, and call-target resolution from `lambdaDispatch0 `.
137
+ * information, and call-target resolution from `virtualDispatch0 `.
138
138
*/
139
139
private DataFlowPrivate:: DataFlowCallable dispatch ( DataFlowPrivate:: DataFlowCall c ) {
140
140
result = nonVirtualDispatch ( c ) or
141
- result = lambdaDispatch0 ( c )
141
+ result = virtualDispatch0 ( c )
142
142
}
143
143
144
144
private module TtInput implements TypeTrackingInput< Location > {
@@ -156,7 +156,7 @@ private module TrackVirtualDispatch<methodDispatchSig/1 lambdaDispatch0> {
156
156
or
157
157
DataFlowPrivate:: jumpStep ( _, this )
158
158
or
159
- lambdaSourceImpl ( this , _)
159
+ qualifierSourceImpl ( this , _)
160
160
}
161
161
}
162
162
@@ -220,21 +220,23 @@ private module TrackVirtualDispatch<methodDispatchSig/1 lambdaDispatch0> {
220
220
predicate hasFeatureBacktrackStoreTarget ( ) { none ( ) }
221
221
}
222
222
223
- private predicate lambdaSource ( RelevantNode n ) { lambdaSourceImpl ( n , _) }
223
+ private predicate qualifierSource ( RelevantNode n ) { qualifierSourceImpl ( n , _) }
224
224
225
225
/**
226
226
* Holds if `n` is the qualifier of `call` which targets the virtual member
227
227
* function `mf`.
228
228
*/
229
- private predicate lambdaSinkImpl ( RelevantNode n , CallInstruction call , MemberFunction mf ) {
229
+ private predicate qualifierOfVirtualCallImpl (
230
+ RelevantNode n , CallInstruction call , MemberFunction mf
231
+ ) {
230
232
n .asOperand ( ) = call .getThisArgumentOperand ( ) and
231
233
call .getStaticCallTarget ( ) = mf and
232
234
mf .isVirtual ( )
233
235
}
234
236
235
- private predicate lambdaSink ( RelevantNode n ) { lambdaSinkImpl ( n , _, _) }
237
+ private predicate qualifierOfVirtualCall ( RelevantNode n ) { qualifierOfVirtualCallImpl ( n , _, _) }
236
238
237
- private import TypeTracking< Location , TtInput > :: TypeTrack< lambdaSource / 1 > :: Graph< lambdaSink / 1 >
239
+ private import TypeTracking< Location , TtInput > :: TypeTrack< qualifierSource / 1 > :: Graph< qualifierOfVirtualCall / 1 >
238
240
239
241
private predicate edgePlus ( PathNode n1 , PathNode n2 ) = fastTC( edges / 2 ) ( n1 , n2 )
240
242
@@ -243,7 +245,7 @@ private module TrackVirtualDispatch<methodDispatchSig/1 lambdaDispatch0> {
243
245
* qualifier has runtime type `c`.
244
246
*/
245
247
private MemberFunction mostSpecific ( MemberFunction mf , Class c ) {
246
- lambdaSinkImpl ( _, _, mf ) and
248
+ qualifierOfVirtualCallImpl ( _, _, mf ) and
247
249
mf .getAnOverridingFunction * ( ) = result and
248
250
(
249
251
result .getDeclaringType ( ) = c
@@ -267,16 +269,16 @@ private module TrackVirtualDispatch<methodDispatchSig/1 lambdaDispatch0> {
267
269
DataFlowPrivate:: DataFlowCall call
268
270
) {
269
271
exists ( Class derived , MemberFunction mf |
270
- lambdaSourceImpl ( p1 .getNode ( ) , derived ) and
271
- lambdaSinkImpl ( p2 .getNode ( ) , call .asCallInstruction ( ) , mf ) and
272
+ qualifierSourceImpl ( p1 .getNode ( ) , derived ) and
273
+ qualifierOfVirtualCallImpl ( p2 .getNode ( ) , call .asCallInstruction ( ) , mf ) and
272
274
p1 .isSource ( ) and
273
275
p2 .isSink ( ) and
274
276
callable .asSourceCallable ( ) = mostSpecific ( mf , derived )
275
277
)
276
278
}
277
279
278
280
/** Gets a possible run-time target of `call`. */
279
- DataFlowPrivate:: DataFlowCallable lambdaDispatch ( DataFlowPrivate:: DataFlowCall call ) {
281
+ DataFlowPrivate:: DataFlowCallable virtualDispatch ( DataFlowPrivate:: DataFlowCall call ) {
280
282
exists ( PathNode p1 , PathNode p2 | p1 = p2 or edgePlus ( p1 , p2 ) | pairCand ( p1 , p2 , result , call ) )
281
283
}
282
284
}
@@ -285,32 +287,32 @@ private DataFlowPrivate::DataFlowCallable noDisp(DataFlowPrivate::DataFlowCall c
285
287
286
288
pragma [ nomagic]
287
289
private DataFlowPrivate:: DataFlowCallable d1 ( DataFlowPrivate:: DataFlowCall call ) {
288
- result = TrackVirtualDispatch< noDisp / 1 > :: lambdaDispatch ( call )
290
+ result = TrackVirtualDispatch< noDisp / 1 > :: virtualDispatch ( call )
289
291
}
290
292
291
293
pragma [ nomagic]
292
294
private DataFlowPrivate:: DataFlowCallable d2 ( DataFlowPrivate:: DataFlowCall call ) {
293
- result = TrackVirtualDispatch< d1 / 1 > :: lambdaDispatch ( call )
295
+ result = TrackVirtualDispatch< d1 / 1 > :: virtualDispatch ( call )
294
296
}
295
297
296
298
pragma [ nomagic]
297
299
private DataFlowPrivate:: DataFlowCallable d3 ( DataFlowPrivate:: DataFlowCall call ) {
298
- result = TrackVirtualDispatch< d2 / 1 > :: lambdaDispatch ( call )
300
+ result = TrackVirtualDispatch< d2 / 1 > :: virtualDispatch ( call )
299
301
}
300
302
301
303
pragma [ nomagic]
302
304
private DataFlowPrivate:: DataFlowCallable d4 ( DataFlowPrivate:: DataFlowCall call ) {
303
- result = TrackVirtualDispatch< d3 / 1 > :: lambdaDispatch ( call )
305
+ result = TrackVirtualDispatch< d3 / 1 > :: virtualDispatch ( call )
304
306
}
305
307
306
308
pragma [ nomagic]
307
309
private DataFlowPrivate:: DataFlowCallable d5 ( DataFlowPrivate:: DataFlowCall call ) {
308
- result = TrackVirtualDispatch< d4 / 1 > :: lambdaDispatch ( call )
310
+ result = TrackVirtualDispatch< d4 / 1 > :: virtualDispatch ( call )
309
311
}
310
312
311
313
pragma [ nomagic]
312
314
private DataFlowPrivate:: DataFlowCallable d6 ( DataFlowPrivate:: DataFlowCall call ) {
313
- result = TrackVirtualDispatch< d5 / 1 > :: lambdaDispatch ( call )
315
+ result = TrackVirtualDispatch< d5 / 1 > :: virtualDispatch ( call )
314
316
}
315
317
316
318
/** Gets a function that might be called by `call`. */
0 commit comments