From e8fee23093faa512e481f4a67ea8e18689a67af9 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Tue, 23 Jun 2026 20:11:00 +0100 Subject: [PATCH] Go: Fixes after changes to the flow summary API. --- go/ql/lib/semmle/go/dataflow/internal/DataFlowUtil.qll | 2 +- go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll | 6 ++++++ go/ql/lib/semmle/go/dataflow/internal/TaintTrackingUtil.qll | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/go/ql/lib/semmle/go/dataflow/internal/DataFlowUtil.qll b/go/ql/lib/semmle/go/dataflow/internal/DataFlowUtil.qll index b29ff7d5ea8..e207a72727f 100644 --- a/go/ql/lib/semmle/go/dataflow/internal/DataFlowUtil.qll +++ b/go/ql/lib/semmle/go/dataflow/internal/DataFlowUtil.qll @@ -141,7 +141,7 @@ predicate simpleLocalFlowStep(Node nodeFrom, Node nodeTo, string model) { any(FunctionModel m).flowStep(nodeFrom, nodeTo) and model = "FunctionModel" or - FlowSummaryImpl::Private::Steps::summaryLocalStep(nodeFrom.(FlowSummaryNode).getSummaryNode(), + FlowSummaryImpl::Private::Steps::summaryLocalStep(nodeFrom, nodeTo.(FlowSummaryNode).getSummaryNode(), true, model) } diff --git a/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll b/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll index ff727286c3b..868066af1e4 100644 --- a/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll +++ b/go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll @@ -31,6 +31,8 @@ module Input implements InputSig { class SinkBase = Void; + class FlowSummaryCallBase = Void; + predicate callableFromSource(SummarizedCallableBase c) { exists(c.getFuncDef()) } predicate neutralElement( @@ -113,6 +115,10 @@ module Input implements InputSig { private import Make as Impl private module StepsInput implements Impl::Private::StepsInputSig { + Impl::Private::SummaryNode getSummaryNode(Node n) { + result = n.(FlowSummaryNode).getSummaryNode() + } + DataFlowCall getACall(Public::SummarizedCallable sc) { exists(DataFlow::CallNode call | call.asExpr() = result and diff --git a/go/ql/lib/semmle/go/dataflow/internal/TaintTrackingUtil.qll b/go/ql/lib/semmle/go/dataflow/internal/TaintTrackingUtil.qll index f9f14874493..de7a1f743c5 100644 --- a/go/ql/lib/semmle/go/dataflow/internal/TaintTrackingUtil.qll +++ b/go/ql/lib/semmle/go/dataflow/internal/TaintTrackingUtil.qll @@ -109,8 +109,8 @@ private predicate localAdditionalForwardTaintStep( or any(AdditionalTaintStep a).step(pred, succ) and model = "AdditionalTaintStep" or - FlowSummaryImpl::Private::Steps::summaryLocalStep(pred.(DataFlowPrivate::FlowSummaryNode) - .getSummaryNode(), succ.(DataFlowPrivate::FlowSummaryNode).getSummaryNode(), false, model) + FlowSummaryImpl::Private::Steps::summaryLocalStep(pred, + succ.(DataFlowPrivate::FlowSummaryNode).getSummaryNode(), false, model) } /**