diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll index 75ccdbecf9f9..dc0da810f11f 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll @@ -246,16 +246,6 @@ module MakeImpl Lang> { ReturnKindExt getKind() { result = pos.getKind() } } - /** If `node` corresponds to a sink, gets the normal node for that sink. */ - pragma[nomagic] - private NodeEx toNormalSinkNodeEx(NodeEx node) { - exists(Node n | - node.asNodeOrImplicitRead() = n and - (Config::isSink(n) or Config::isSink(n, _)) and - result.asNode() = n - ) - } - private predicate inBarrier(NodeEx node) { exists(Node n | node.asNode() = n and @@ -2607,7 +2597,7 @@ module MakeImpl Lang> { TPathNodeSink(NodeEx node, FlowState state) { exists(PathNodeMid sink | sink.isAtSink() and - node = toNormalSinkNodeEx(sink.getNodeEx()) and + node = sink.toNormalSinkNodeEx() and state = sink.getState() ) } or @@ -2734,6 +2724,16 @@ module MakeImpl Lang> { ) } + /** If this node corresponds to a sink, gets the normal node for that sink. */ + pragma[nomagic] + NodeEx toNormalSinkNodeEx() { + exists(Node n | + pragma[only_bind_out](node.asNodeOrImplicitRead()) = n and + (Config::isSink(n) or Config::isSink(n, _)) and + result.asNode() = n + ) + } + override PathNodeImpl getASuccessorImpl(string label) { // an intermediate step to another intermediate node exists(string l2 | result = this.getSuccMid(l2) | @@ -2825,7 +2825,7 @@ module MakeImpl Lang> { PathNodeSink projectToSink(string model) { this.isAtSink() and sinkModel(node, model) and - result.getNodeEx() = toNormalSinkNodeEx(node) and + result.getNodeEx() = this.toNormalSinkNodeEx() and result.getState() = state } }