Skip to content

Commit c944f1d

Browse files
committed
Document elementAppliesToQualifier
1 parent da13e6b commit c944f1d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

+8
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,14 @@ module SourceSinkInterpretationInput implements
271271
}
272272
}
273273

274+
/**
275+
* Holds if method or field spec `sse` applies in the context of qualifier `qual`.
276+
*
277+
* Note that naively checking `sse.asEntity()`'s qualified name is not correct, because
278+
* `Method`s and `Field`s may have multiple qualified names due to embedding. We must instead
279+
* check that the specific name given be `sse.hasTypeInfo` refers to either `qual`'s type
280+
* or to a type it embeds.
281+
*/
274282
private predicate elementAppliesToQualifier(SourceOrSinkElement sse, DataFlow::Node qual) {
275283
(
276284
exists(DataFlow::CallNode cn | cn.getReceiver() = qual and cn.getTarget() = sse.asEntity())

0 commit comments

Comments
 (0)