@@ -292,7 +292,7 @@ module SourceSinkInterpretationInput implements
292
292
|
293
293
sse .hasTypeInfo ( pkg , typename , subtypes ) and
294
294
targetType .hasQualifiedName ( pkg , typename ) and
295
- syntacticQualBaseType = lookThroughPointerType ( getSyntacticQualifier ( qual ) . getType ( ) )
295
+ syntacticQualBaseType = getSyntacticQualifierBaseType ( qual )
296
296
|
297
297
subtypes = [ true , false ] and
298
298
syntacticQualBaseType = targetType
@@ -336,21 +336,22 @@ module SourceSinkInterpretationInput implements
336
336
}
337
337
338
338
/**
339
- * Gets `underlying`, where `n` if of the form `implicitDeref?(underlying.implicitFieldRead1.implicitFieldRead2...)`
339
+ * Gets the base type of `underlying`, where `n` is of the form
340
+ * `implicitDeref?(underlying.implicitFieldRead1.implicitFieldRead2...)`
340
341
*
341
342
* For Go syntax like `qualifier.method()` or `qualifier.field`, this is the type of `qualifier`, before any
342
343
* implicit dereference is interposed because `qualifier` is of pointer type, or implicit field accesses
343
344
* navigate to any embedded struct types that truly host `field`.
344
345
*/
345
- private DataFlow :: Node getSyntacticQualifier ( DataFlow:: Node n ) {
346
+ private Type getSyntacticQualifierBaseType ( DataFlow:: Node n ) {
346
347
exists ( DataFlow:: Node n2 |
347
348
// look through implicit dereference, if there is one
348
349
not exists ( n .asInstruction ( ) .( IR:: EvalImplicitDerefInstruction ) .getOperand ( ) ) and
349
350
n2 = n
350
351
or
351
352
n2 .asExpr ( ) = n .asInstruction ( ) .( IR:: EvalImplicitDerefInstruction ) .getOperand ( )
352
353
|
353
- result = skipImplicitFieldReads ( n2 )
354
+ result = lookThroughPointerType ( skipImplicitFieldReads ( n2 ) . getType ( ) )
354
355
)
355
356
}
356
357
0 commit comments