From 98f51d7f29bd1f06a199a44007b4f90116a0c663 Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Fri, 26 May 2023 14:59:25 +0200 Subject: [PATCH] Dataflow: Sync. --- .../code/csharp/dataflow/internal/FlowSummaryImpl.qll | 8 ++++++++ go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll | 8 ++++++++ .../python/dataflow/new/internal/FlowSummaryImpl.qll | 8 ++++++++ .../lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll | 8 ++++++++ .../codeql/swift/dataflow/internal/FlowSummaryImpl.qll | 8 ++++++++ 5 files changed, 40 insertions(+) diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll index fa803e6cc92..f98c2669a8b 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll @@ -505,6 +505,9 @@ module Private { or // Add the post-update node corresponding to the requested argument node outputState(c, s) and isCallbackParameter(s) + or + // Add the parameter node for parameter side-effects + outputState(c, s) and s = SummaryComponentStack::argument(_) } private newtype TSummaryNodeState = @@ -713,6 +716,11 @@ module Private { head = TSyntheticGlobalSummaryComponent(sg) and result = getSyntheticGlobalType(sg) ) + or + exists(ParameterPosition pos | + head = TArgumentSummaryComponent(pos) and + result = getParameterType(c, pos) + ) ) or n = summaryNodeOutputState(c, s) and diff --git a/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll b/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll index fa803e6cc92..f98c2669a8b 100644 --- a/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll +++ b/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll @@ -505,6 +505,9 @@ module Private { or // Add the post-update node corresponding to the requested argument node outputState(c, s) and isCallbackParameter(s) + or + // Add the parameter node for parameter side-effects + outputState(c, s) and s = SummaryComponentStack::argument(_) } private newtype TSummaryNodeState = @@ -713,6 +716,11 @@ module Private { head = TSyntheticGlobalSummaryComponent(sg) and result = getSyntheticGlobalType(sg) ) + or + exists(ParameterPosition pos | + head = TArgumentSummaryComponent(pos) and + result = getParameterType(c, pos) + ) ) or n = summaryNodeOutputState(c, s) and diff --git a/python/ql/lib/semmle/python/dataflow/new/internal/FlowSummaryImpl.qll b/python/ql/lib/semmle/python/dataflow/new/internal/FlowSummaryImpl.qll index fa803e6cc92..f98c2669a8b 100644 --- a/python/ql/lib/semmle/python/dataflow/new/internal/FlowSummaryImpl.qll +++ b/python/ql/lib/semmle/python/dataflow/new/internal/FlowSummaryImpl.qll @@ -505,6 +505,9 @@ module Private { or // Add the post-update node corresponding to the requested argument node outputState(c, s) and isCallbackParameter(s) + or + // Add the parameter node for parameter side-effects + outputState(c, s) and s = SummaryComponentStack::argument(_) } private newtype TSummaryNodeState = @@ -713,6 +716,11 @@ module Private { head = TSyntheticGlobalSummaryComponent(sg) and result = getSyntheticGlobalType(sg) ) + or + exists(ParameterPosition pos | + head = TArgumentSummaryComponent(pos) and + result = getParameterType(c, pos) + ) ) or n = summaryNodeOutputState(c, s) and diff --git a/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll b/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll index fa803e6cc92..f98c2669a8b 100644 --- a/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll +++ b/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll @@ -505,6 +505,9 @@ module Private { or // Add the post-update node corresponding to the requested argument node outputState(c, s) and isCallbackParameter(s) + or + // Add the parameter node for parameter side-effects + outputState(c, s) and s = SummaryComponentStack::argument(_) } private newtype TSummaryNodeState = @@ -713,6 +716,11 @@ module Private { head = TSyntheticGlobalSummaryComponent(sg) and result = getSyntheticGlobalType(sg) ) + or + exists(ParameterPosition pos | + head = TArgumentSummaryComponent(pos) and + result = getParameterType(c, pos) + ) ) or n = summaryNodeOutputState(c, s) and diff --git a/swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll b/swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll index fa803e6cc92..f98c2669a8b 100644 --- a/swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll +++ b/swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll @@ -505,6 +505,9 @@ module Private { or // Add the post-update node corresponding to the requested argument node outputState(c, s) and isCallbackParameter(s) + or + // Add the parameter node for parameter side-effects + outputState(c, s) and s = SummaryComponentStack::argument(_) } private newtype TSummaryNodeState = @@ -713,6 +716,11 @@ module Private { head = TSyntheticGlobalSummaryComponent(sg) and result = getSyntheticGlobalType(sg) ) + or + exists(ParameterPosition pos | + head = TArgumentSummaryComponent(pos) and + result = getParameterType(c, pos) + ) ) or n = summaryNodeOutputState(c, s) and