From c11fac81fd5dcc9b14ff42adff823f58ce3f2e83 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 7 May 2024 13:55:42 +0100 Subject: [PATCH 1/2] Make summaryThroughStepValue include param outputs This matches summaryThroughStepTaint. --- .../dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll b/shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll index 89a2a23d53bb..78950806f7d6 100644 --- a/shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll +++ b/shared/dataflow/codeql/dataflow/internal/FlowSummaryImpl.qll @@ -1286,10 +1286,8 @@ module Make< * be useful to include in the exposed local data-flow/taint-tracking relations. */ predicate summaryThroughStepValue(ArgNode arg, Node out, SummarizedCallable sc) { - exists(ReturnKind rk, SummaryNode ret, DataFlowCall call | - summaryLocalStep(summaryArgParam(call, arg, sc), ret, true, _) and - summaryReturnNode(ret, pragma[only_bind_into](rk)) and - out = getAnOutNode(call, pragma[only_bind_into](rk)) + exists(SummaryNode ret | + summaryLocalStep(summaryArgParamRetOut(arg, ret, out, sc), ret, true, _) ) } From aab43afd8129d64db21507ea04970a9e38900e62 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Tue, 7 May 2024 15:36:48 +0100 Subject: [PATCH 2/2] Swift: accept test changes --- .../ql/test/library-tests/dataflow/dataflow/LocalFlow.expected | 2 ++ 1 file changed, 2 insertions(+) diff --git a/swift/ql/test/library-tests/dataflow/dataflow/LocalFlow.expected b/swift/ql/test/library-tests/dataflow/dataflow/LocalFlow.expected index 5a1e142d9457..4456b1a4ac2d 100644 --- a/swift/ql/test/library-tests/dataflow/dataflow/LocalFlow.expected +++ b/swift/ql/test/library-tests/dataflow/dataflow/LocalFlow.expected @@ -794,8 +794,10 @@ | test.swift:680:10:680:11 | &... | test.swift:681:15:681:15 | x | | test.swift:680:11:680:11 | [post] x | test.swift:680:10:680:11 | &... | | test.swift:680:11:680:11 | x | test.swift:680:10:680:11 | &... | +| test.swift:680:11:680:11 | x | test.swift:680:15:680:15 | [post] y | | test.swift:680:14:680:15 | &... | test.swift:682:15:682:15 | y | | test.swift:680:15:680:15 | [post] y | test.swift:680:14:680:15 | &... | +| test.swift:680:15:680:15 | y | test.swift:680:11:680:11 | [post] x | | test.swift:680:15:680:15 | y | test.swift:680:14:680:15 | &... | | test.swift:686:9:686:9 | SSA def(arr1) | test.swift:687:15:687:15 | arr1 | | test.swift:686:9:686:9 | arr1 | test.swift:686:9:686:9 | SSA def(arr1) |