mirror of
https://github.com/github/codeql.git
synced 2026-04-26 17:25:19 +02:00
C++: Add models-as-data case to allowParameterReturnInSelf.
This commit is contained in:
@@ -1280,7 +1280,12 @@ predicate additionalLambdaFlowStep(Node nodeFrom, Node nodeTo, boolean preserves
|
||||
*/
|
||||
predicate allowParameterReturnInSelf(ParameterNode p) {
|
||||
p instanceof IndirectParameterNode
|
||||
// TODO: Swift has a case for summarized callables here.
|
||||
or
|
||||
// models-as-data summarized flow
|
||||
exists(DataFlowCallable c, ParameterPosition pos |
|
||||
p.(ParameterNode).isParameterOf(c, pos) and
|
||||
FlowSummaryImpl::Private::summaryAllowParameterReturnInSelf(c.asSummarizedCallable(), pos)
|
||||
)
|
||||
}
|
||||
|
||||
private predicate fieldHasApproxName(Field f, string s) {
|
||||
|
||||
Reference in New Issue
Block a user