diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll index bbc0ab8a1a2..a3aed9f9097 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/DataFlowPrivate.qll @@ -1125,16 +1125,14 @@ private module ParameterNodes { /** A parameter for a library callable with a flow summary. */ class SummaryParameterNode extends ParameterNodeImpl, FlowSummaryNode { - SummaryParameterNode() { - FlowSummaryImpl::Private::summaryParameterNode(this.getSummaryNode(), _) - } + private ParameterPosition pos_; - private ParameterPosition getPosition() { - FlowSummaryImpl::Private::summaryParameterNode(this.getSummaryNode(), result) + SummaryParameterNode() { + FlowSummaryImpl::Private::summaryParameterNode(this.getSummaryNode(), pos_) } override predicate isParameterOf(DataFlowCallable c, ParameterPosition pos) { - this.getSummarizedCallable() = c.asSummarizedCallable() and pos = this.getPosition() + this.getSummarizedCallable() = c.asSummarizedCallable() and pos = pos_ } } } @@ -1305,12 +1303,15 @@ private module ArgumentNodes { } private class SummaryArgumentNode extends FlowSummaryNode, ArgumentNodeImpl { + private DataFlowCall call_; + private ArgumentPosition pos_; + SummaryArgumentNode() { - FlowSummaryImpl::Private::summaryArgumentNode(_, this.getSummaryNode(), _) + FlowSummaryImpl::Private::summaryArgumentNode(call_, this.getSummaryNode(), pos_) } override predicate argumentOf(DataFlowCall call, ArgumentPosition pos) { - FlowSummaryImpl::Private::summaryArgumentNode(call, this.getSummaryNode(), pos) + call = call_ and pos = pos_ } } } @@ -1593,11 +1594,14 @@ private module OutNodes { } private class SummaryOutNode extends FlowSummaryNode, OutNode { - SummaryOutNode() { FlowSummaryImpl::Private::summaryOutNode(_, this.getSummaryNode(), _) } + private DataFlowCall call; + private ReturnKind kind_; - override DataFlowCall getCall(ReturnKind kind) { - FlowSummaryImpl::Private::summaryOutNode(result, this.getSummaryNode(), kind) + SummaryOutNode() { + FlowSummaryImpl::Private::summaryOutNode(call, this.getSummaryNode(), kind_) } + + override DataFlowCall getCall(ReturnKind kind) { result = call and kind = kind_ } } } @@ -2120,15 +2124,14 @@ private module PostUpdateNodes { } private class SummaryPostUpdateNode extends FlowSummaryNode, PostUpdateNode { + private FlowSummaryImpl::Private::SummaryNode preUpdateNode; + SummaryPostUpdateNode() { - FlowSummaryImpl::Private::summaryPostUpdateNode(this.getSummaryNode(), _) and + FlowSummaryImpl::Private::summaryPostUpdateNode(this.getSummaryNode(), preUpdateNode) and not summaryPostUpdateNodeIsOutOrRef(this, _) } - override Node getPreUpdateNode() { - FlowSummaryImpl::Private::summaryPostUpdateNode(this.getSummaryNode(), - result.(FlowSummaryNode).getSummaryNode()) - } + override Node getPreUpdateNode() { result.(FlowSummaryNode).getSummaryNode() = preUpdateNode } } } 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 f98c2669a8b..03c215e1f67 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll @@ -570,7 +570,7 @@ module Private { summaryParameterNodeRange(c, pos) } - class SummaryNode extends TSummaryNode { + abstract class SummaryNode extends TSummaryNode { abstract string toString(); abstract SummarizedCallable getSummarizedCallable(); diff --git a/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll b/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll index f98c2669a8b..03c215e1f67 100644 --- a/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll +++ b/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll @@ -570,7 +570,7 @@ module Private { summaryParameterNodeRange(c, pos) } - class SummaryNode extends TSummaryNode { + abstract class SummaryNode extends TSummaryNode { abstract string toString(); abstract SummarizedCallable getSummarizedCallable(); 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 f98c2669a8b..03c215e1f67 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll @@ -570,7 +570,7 @@ module Private { summaryParameterNodeRange(c, pos) } - class SummaryNode extends TSummaryNode { + abstract class SummaryNode extends TSummaryNode { abstract string toString(); abstract SummarizedCallable getSummarizedCallable(); 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 f98c2669a8b..03c215e1f67 100644 --- a/python/ql/lib/semmle/python/dataflow/new/internal/FlowSummaryImpl.qll +++ b/python/ql/lib/semmle/python/dataflow/new/internal/FlowSummaryImpl.qll @@ -570,7 +570,7 @@ module Private { summaryParameterNodeRange(c, pos) } - class SummaryNode extends TSummaryNode { + abstract class SummaryNode extends TSummaryNode { abstract string toString(); abstract SummarizedCallable getSummarizedCallable(); diff --git a/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll b/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll index ecb9393f127..0fb0bac0462 100644 --- a/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll +++ b/ruby/ql/lib/codeql/ruby/dataflow/internal/DataFlowPrivate.qll @@ -751,18 +751,16 @@ private module ParameterNodes { /** A parameter for a library callable with a flow summary. */ class SummaryParameterNode extends ParameterNodeImpl, FlowSummaryNode { - SummaryParameterNode() { - FlowSummaryImpl::Private::summaryParameterNode(this.getSummaryNode(), _) - } + private ParameterPosition pos_; - private ParameterPosition getPosition() { - FlowSummaryImpl::Private::summaryParameterNode(this.getSummaryNode(), result) + SummaryParameterNode() { + FlowSummaryImpl::Private::summaryParameterNode(this.getSummaryNode(), pos_) } override Parameter getParameter() { none() } override predicate isParameterOf(DataFlowCallable c, ParameterPosition pos) { - this.getSummarizedCallable() = c.asLibraryCallable() and pos = this.getPosition() + this.getSummarizedCallable() = c.asLibraryCallable() and pos = pos_ } } } @@ -847,8 +845,11 @@ private module ArgumentNodes { } private class SummaryArgumentNode extends FlowSummaryNode, ArgumentNode { + private DataFlowCall call_; + private ArgumentPosition pos_; + SummaryArgumentNode() { - FlowSummaryImpl::Private::summaryArgumentNode(_, this.getSummaryNode(), _) + FlowSummaryImpl::Private::summaryArgumentNode(call_, this.getSummaryNode(), pos_) } override predicate sourceArgumentOf(CfgNodes::ExprNodes::CallCfgNode call, ArgumentPosition pos) { @@ -856,7 +857,7 @@ private module ArgumentNodes { } override predicate argumentOf(DataFlowCall call, ArgumentPosition pos) { - FlowSummaryImpl::Private::summaryArgumentNode(call, this.getSummaryNode(), pos) + call = call_ and pos = pos_ } } @@ -1063,11 +1064,14 @@ private module OutNodes { } private class SummaryOutNode extends FlowSummaryNode, OutNode { - SummaryOutNode() { FlowSummaryImpl::Private::summaryOutNode(_, this.getSummaryNode(), _) } + private DataFlowCall call; + private ReturnKind kind_; - override DataFlowCall getCall(ReturnKind kind) { - FlowSummaryImpl::Private::summaryOutNode(result, this.getSummaryNode(), kind) + SummaryOutNode() { + FlowSummaryImpl::Private::summaryOutNode(call, this.getSummaryNode(), kind_) } + + override DataFlowCall getCall(ReturnKind kind) { result = call and kind = kind_ } } } diff --git a/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll b/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll index f98c2669a8b..03c215e1f67 100644 --- a/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll +++ b/ruby/ql/lib/codeql/ruby/dataflow/internal/FlowSummaryImpl.qll @@ -570,7 +570,7 @@ module Private { summaryParameterNodeRange(c, pos) } - class SummaryNode extends TSummaryNode { + abstract class SummaryNode extends TSummaryNode { abstract string toString(); abstract SummarizedCallable getSummarizedCallable(); diff --git a/swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll b/swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll index f98c2669a8b..03c215e1f67 100644 --- a/swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll +++ b/swift/ql/lib/codeql/swift/dataflow/internal/FlowSummaryImpl.qll @@ -570,7 +570,7 @@ module Private { summaryParameterNodeRange(c, pos) } - class SummaryNode extends TSummaryNode { + abstract class SummaryNode extends TSummaryNode { abstract string toString(); abstract SummarizedCallable getSummarizedCallable();