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 424f3651bf884..38e893e023859 100644 --- a/cpp/ql/lib/semmle/code/cpp/dataflow/internal/FlowSummaryImpl.qll +++ b/cpp/ql/lib/semmle/code/cpp/dataflow/internal/FlowSummaryImpl.qll @@ -12,8 +12,12 @@ private import semmle.code.cpp.dataflow.ExternalFlow private import semmle.code.cpp.ir.IR module Input implements InputSig { + private import codeql.util.Void + class SummarizedCallableBase = Function; + class SourceBase = 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 d777566a336a1..e0736e7102ac7 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll @@ -14,8 +14,12 @@ private import semmle.code.csharp.Unification private import semmle.code.csharp.dataflow.internal.ExternalFlow module Input implements InputSig { + private import codeql.util.Void + class SummarizedCallableBase = UnboundCallable; + class SourceBase = 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/ExternalFlow.qll b/go/ql/lib/semmle/go/dataflow/ExternalFlow.qll index 5ae7b6a7f0d8d..3228f42488594 100644 --- a/go/ql/lib/semmle/go/dataflow/ExternalFlow.qll +++ b/go/ql/lib/semmle/go/dataflow/ExternalFlow.qll @@ -90,7 +90,7 @@ import internal.ExternalFlowExtensions as FlowExtensions private import FlowSummary as FlowSummary private import internal.DataFlowPrivate private import internal.FlowSummaryImpl -private import internal.FlowSummaryImpl::Public +private import internal.FlowSummaryImpl::Public as Public private import internal.FlowSummaryImpl::Private private import internal.FlowSummaryImpl::Private::External private import codeql.mad.ModelValidation as SharedModelVal @@ -583,13 +583,13 @@ predicate sourceNode(DataFlow::Node node, string kind) { sourceNode(node, kind, predicate sinkNode(DataFlow::Node node, string kind) { sinkNode(node, kind, _) } // adapter class for converting Mad summaries to `SummarizedCallable`s -private class SummarizedCallableAdapter extends SummarizedCallable { +private class SummarizedCallableAdapter extends Public::SummarizedCallable { SummarizedCallableAdapter() { summaryElement(this, _, _, _, _, _) } private predicate relevantSummaryElementManual( string input, string output, string kind, string model ) { - exists(Provenance provenance | + exists(Public::Provenance provenance | summaryElement(this, input, output, kind, provenance, model) and provenance.isManual() ) @@ -598,11 +598,11 @@ private class SummarizedCallableAdapter extends SummarizedCallable { private predicate relevantSummaryElementGenerated( string input, string output, string kind, string model ) { - exists(Provenance provenance | + exists(Public::Provenance provenance | summaryElement(this, input, output, kind, provenance, model) and provenance.isGenerated() ) and - not exists(Provenance provenance | + not exists(Public::Provenance provenance | neutralElement(this, "summary", provenance) and provenance.isManual() ) @@ -621,7 +621,7 @@ private class SummarizedCallableAdapter extends SummarizedCallable { ) } - override predicate hasProvenance(Provenance provenance) { + override predicate hasProvenance(Public::Provenance provenance) { summaryElement(this, _, _, _, provenance, _) } } diff --git a/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll b/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll index 40c68ceb900a9..3ef544165ad98 100644 --- a/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll +++ b/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll @@ -21,8 +21,12 @@ private string positionToString(int pos) { } module Input implements InputSig { + private import codeql.util.Void + class SummarizedCallableBase = Callable; + class SourceBase = 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 b4a2bad48f351..e2e2add9ac8e4 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll @@ -27,8 +27,12 @@ private string positionToString(int pos) { } module Input implements InputSig { + private import codeql.util.Void + class SummarizedCallableBase = FlowSummary::SummarizedCallableBase; + class SourceBase = 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 a1dd67a008ad0..ebc4973259558 100644 --- a/python/ql/lib/semmle/python/dataflow/new/internal/FlowSummaryImpl.qll +++ b/python/ql/lib/semmle/python/dataflow/new/internal/FlowSummaryImpl.qll @@ -10,8 +10,12 @@ private import DataFlowImplSpecific::Private private import DataFlowImplSpecific::Public module Input implements InputSig { + private import codeql.util.Void + class SummarizedCallableBase = string; + class SourceBase = 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 d0beb44ac7b4e..1a683d01931f9 100644 --- a/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll +++ b/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll @@ -10,8 +10,12 @@ private import DataFlowImplSpecific::Private private import DataFlowImplSpecific::Public module Input implements InputSig { + private import codeql.util.Void + class SummarizedCallableBase = string; + class SourceBase = 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 0898f7b5355ea..327bf002f762c 100644 --- a/swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll +++ b/swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll @@ -12,8 +12,12 @@ private import DataFlowImplCommon private import codeql.swift.dataflow.ExternalFlow module Input implements InputSig { + private import codeql.util.Void + class SummarizedCallableBase = Function; + class SourceBase = Void; + ArgumentPosition callbackSelfParameterPosition() { result instanceof ThisArgumentPosition } ReturnKind getStandardReturnValueKind() { result instanceof NormalReturnKind }