From 707bebb37a0806b21d4baa152b277d6395f7f2c5 Mon Sep 17 00:00:00 2001 From: Tom Hvitved Date: Tue, 17 Dec 2024 14:59:04 +0100 Subject: [PATCH] Data flow: Dummy `SinkBase` implementations --- .../lib/semmle/code/cpp/dataflow/internal/FlowSummaryImpl.qll | 2 ++ .../semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll | 2 ++ go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll | 2 ++ .../lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll | 2 ++ .../lib/semmle/python/dataflow/new/internal/FlowSummaryImpl.qll | 2 ++ ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll | 2 ++ swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll | 2 ++ 7 files changed, 14 insertions(+) diff --git a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/FlowSummaryImpl.qll b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/FlowSummaryImpl.qll index 38e893e023859..df40deed076fd 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/FlowSummaryImpl.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/FlowSummaryImpl.qll @@ -18,6 +18,8 @@ module Input implements InputSig { class SourceBase = Void; + class SinkBase = Void; + ArgumentPosition callbackSelfParameterPosition() { result = TDirectPosition(-1) } ReturnKind getStandardReturnValueKind() { result.(NormalReturnKind).getIndirectionIndex() = 0 } 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 e0736e7102ac7..1fea8e4addd12 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll @@ -20,6 +20,8 @@ module Input implements InputSig class SourceBase = Void; + class SinkBase = Void; + predicate neutralElement(SummarizedCallableBase c, string kind, string provenance, boolean isExact) { interpretNeutral(c, kind, provenance) and // isExact is not needed for C#. diff --git a/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll b/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll index 3ef544165ad98..64382b5f4d6a0 100644 --- a/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll +++ b/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll @@ -27,6 +27,8 @@ module Input implements InputSig { class SourceBase = Void; + class SinkBase = Void; + predicate neutralElement( Input::SummarizedCallableBase c, string kind, string provenance, boolean isExact ) { diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll b/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll index e2e2add9ac8e4..c120ce0e3e368 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll @@ -33,6 +33,8 @@ module Input implements InputSig { class SourceBase = Void; + class SinkBase = Void; + predicate neutralElement( Input::SummarizedCallableBase c, string kind, string provenance, boolean isExact ) { 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 ebc4973259558..a9aaf91de80ab 100644 --- a/python/ql/lib/semmle/python/dataflow/new/internal/FlowSummaryImpl.qll +++ b/python/ql/lib/semmle/python/dataflow/new/internal/FlowSummaryImpl.qll @@ -16,6 +16,8 @@ module Input implements InputSig class SourceBase = Void; + class SinkBase = Void; + ArgumentPosition callbackSelfParameterPosition() { result.isLambdaSelf() } ReturnKind getStandardReturnValueKind() { any() } diff --git a/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll b/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll index 1a683d01931f9..1fbcedc2802d6 100644 --- a/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll +++ b/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll @@ -16,6 +16,8 @@ module Input implements InputSig { class SourceBase = Void; + class SinkBase = Void; + ArgumentPosition callbackSelfParameterPosition() { result.isLambdaSelf() } ReturnKind getStandardReturnValueKind() { result instanceof NormalReturnKind } diff --git a/swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll b/swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll index 327bf002f762c..454c88c86e1cf 100644 --- a/swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll +++ b/swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll @@ -18,6 +18,8 @@ module Input implements InputSig class SourceBase = Void; + class SinkBase = Void; + ArgumentPosition callbackSelfParameterPosition() { result instanceof ThisArgumentPosition } ReturnKind getStandardReturnValueKind() { result instanceof NormalReturnKind }