Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 23fd3f6

Browse files
committed
C++: Add models-as-data case to allowParameterReturnInSelf.
1 parent 26ef1bc commit 23fd3f6

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,12 @@ predicate additionalLambdaFlowStep(Node nodeFrom, Node nodeTo, boolean preserves
12801280
*/
12811281
predicate allowParameterReturnInSelf(ParameterNode p) {
12821282
p instanceof IndirectParameterNode
1283-
// TODO: Swift has a case for summarized callables here.
1283+
or
1284+
// models-as-data summarized flow
1285+
exists(DataFlowCallable c, ParameterPosition pos |
1286+
p.(ParameterNode).isParameterOf(c, pos) and
1287+
FlowSummaryImpl::Private::summaryAllowParameterReturnInSelf(c.asSummarizedCallable(), pos)
1288+
)
12841289
}
12851290

12861291
private predicate fieldHasApproxName(Field f, string s) {

0 commit comments

Comments
 (0)