From f11ae49312c34924e157d0885ac435af51d17c26 Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Thu, 16 Jan 2025 10:25:55 +0100 Subject: [PATCH 1/2] Dataflow: Fix a poor join-order. --- .../dataflow/codeql/dataflow/internal/DataFlowImpl.qll | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll index 29d2e119921c..1e82facac765 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll @@ -3127,6 +3127,14 @@ module MakeImpl Lang> { override predicate isSource() { sourceNode(node, state) } } + bindingset[p, state, t, ap, stored] + pragma[inline_late] + private SummaryCtxSome mkSummaryCtxSome( + ParamNodeEx p, FlowState state, Typ t, Ap ap, TypOption stored + ) { + result = TSummaryCtxSome(p, state, t, ap, stored) + } + pragma[nomagic] private predicate fwdFlowInStep( ArgNodeEx arg, ParamNodeEx p, FlowState state, Cc outercc, CcCall innercc, @@ -3138,7 +3146,7 @@ module MakeImpl Lang> { or FwdFlowInThrough::fwdFlowIn(_, arg, _, p, state, outercc, innercc, outerSummaryCtx, t, ap, stored, _) and - innerSummaryCtx = TSummaryCtxSome(p, state, t, ap, stored) + innerSummaryCtx = mkSummaryCtxSome(p, state, t, ap, stored) } pragma[nomagic] From 4223971f14bb0344f1c39f81cde267ae5216320b Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Thu, 16 Jan 2025 10:26:40 +0100 Subject: [PATCH 2/2] Dataflow: Remove outdated comment. --- shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll | 5 ----- 1 file changed, 5 deletions(-) diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll index 1e82facac765..455a5b5bc131 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll @@ -3879,11 +3879,6 @@ module MakeImpl Lang> { bindingset[node, state, t0, ap] predicate filter(NodeEx node, FlowState state, Typ t0, Ap ap, Typ t) { exists(state) and - // We can get away with not using type strengthening here, since we aren't - // going to use the tracked types in the construction of Stage 4 access - // paths. For Stage 4 and onwards, the tracked types must be consistent as - // the cons candidates including types are used to construct subsequent - // access path approximations. t0 = t and ( notExpectsContent(node)