@@ -276,42 +276,23 @@ module SourceSinkInterpretationInput implements
276
276
or
277
277
exists ( DataFlow:: Write fw | fw .writesField ( recv , sse .asEntity ( ) , _) )
278
278
) and
279
- exists ( string pkg , string typename , boolean subtypes , Type syntacticRecvBaseType |
279
+ exists ( string pkg , string typename , boolean subtypes , Type syntacticRecvBaseType , Type targetType |
280
280
sse .hasTypeInfo ( pkg , typename , subtypes ) and
281
+ targetType .hasQualifiedName ( pkg , typename ) and
281
282
syntacticRecvBaseType = lookThroughPointerType ( getSyntacticRecv ( recv ) .getType ( ) )
282
283
|
283
284
subtypes = [ true , false ] and
284
- syntacticRecvBaseType . hasQualifiedName ( pkg , typename )
285
+ syntacticRecvBaseType = targetType
285
286
or
286
287
subtypes = true and
287
288
(
288
289
// `syntacticRecvBaseType`'s underlying type might be an interface type and `sse`
289
290
// might be a method defined on an interface which is a subtype of it.
290
- exists ( Type t |
291
- t = syntacticRecvBaseType .getUnderlyingType ( ) .( InterfaceType ) .getAnEmbeddedInterface ( ) and
292
- t .hasQualifiedName ( pkg , typename ) and
293
- sse .asEntity ( ) .( Method ) .hasQualifiedName ( pkg , typename , _)
294
- )
291
+ targetType = syntacticRecvBaseType .getUnderlyingType ( ) .( InterfaceType ) .getAnEmbeddedInterface ( )
295
292
or
296
293
// `syntacticRecvBaseType`'s underlying type might be a struct type and `sse`
297
294
// might be a promoted method or field.
298
- exists ( StructType st , Field field1 , Field field2 , int depth1 , int depth2 , Type t1 , Type t2 |
299
- st = syntacticRecvBaseType .getUnderlyingType ( ) and
300
- field1 = st .getFieldAtDepth ( _, depth1 ) and
301
- field2 = st .getFieldAtDepth ( _, depth2 ) and
302
- t1 = lookThroughPointerType ( field1 .getType ( ) ) and
303
- t2 = lookThroughPointerType ( field2 .getType ( ) ) and
304
- (
305
- field1 = field2
306
- or
307
- field2 = t1 .getUnderlyingType ( ) .( StructType ) .getFieldAtDepth ( _, depth2 - depth1 - 1 )
308
- ) and
309
- matchTypeInfo ( sse , t1 )
310
- |
311
- sse .asEntity ( ) .( Method ) .getReceiverBaseType ( ) = t2
312
- or
313
- sse .asEntity ( ) .( Field ) .getDeclaringType ( ) = t2 .getUnderlyingType ( )
314
- )
295
+ syntacticRecvBaseType .getUnderlyingType ( ) .( StructType ) .hasEmbeddedField ( targetType , _)
315
296
)
316
297
)
317
298
}
@@ -343,15 +324,6 @@ module SourceSinkInterpretationInput implements
343
324
.getBaseInstruction ( )
344
325
}
345
326
346
- bindingset [ sse, t]
347
- pragma [ inline_late]
348
- private predicate matchTypeInfo ( SourceOrSinkElement sse , Type t ) {
349
- exists ( string pkg , string typename |
350
- sse .hasTypeInfo ( pkg , typename , true ) and
351
- t .hasQualifiedName ( pkg , typename )
352
- )
353
- }
354
-
355
327
/** Provides additional sink specification logic. */
356
328
bindingset [ c]
357
329
predicate interpretOutput ( string c , InterpretNode mid , InterpretNode node ) {
0 commit comments