Skip to content

Commit cd99bea

Browse files
smowtonowen-mc
authored andcommitted
Explain getSyntacticQual
1 parent ccc525a commit cd99bea

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,13 @@ module SourceSinkInterpretationInput implements
303303
)
304304
}
305305

306+
/**
307+
* Gets `underlying`, where `n` if of the form `implicitDeref?(underlying.implicitFieldRead1.implicitFieldRead2...)`
308+
*
309+
* For Go syntax like `qualifier.method()` or `qualifier.field`, this is the type of `qualifier`, before any
310+
* implicit dereference is interposed because `qualifier` is of pointer type, or implicit field accesses
311+
* navigate to any embedded struct types that truly host `field`.
312+
*/
306313
private DataFlow::Node getSyntacticQualifier(DataFlow::Node n) {
307314
exists(DataFlow::Node n2 |
308315
// look through implicit dereference, if there is one

0 commit comments

Comments
 (0)