From 3ffc61617906fff1271ac8c7a94f5cbf31bc060f Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Thu, 16 Jan 2025 13:03:46 +0100 Subject: [PATCH 1/2] Dataflow: Slight join improvement. --- shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll index 455a5b5bc131..8aa5a18650ba 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll @@ -2154,8 +2154,7 @@ module MakeImpl Lang> { pragma[nomagic] private predicate storeStepFwd(NodeEx node1, Ap ap1, Content c, NodeEx node2, Ap ap2) { fwdFlowStore(node1, _, ap1, _, c, _, _, node2, _, _, _) and - ap2 = apCons(c, ap1) and - readStepFwd(_, ap2, c, _, _) + readStepFwd(_, ap2, c, _, ap1) } pragma[nomagic] From 20af2d5fe28c678506281d4f76e0e67fc76a223c Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Thu, 16 Jan 2025 13:04:05 +0100 Subject: [PATCH 2/2] Dataflow: Fix poor join-order --- shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll index 8aa5a18650ba..b9840504615f 100644 --- a/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll +++ b/shared/dataflow/codeql/dataflow/internal/DataFlowImpl.qll @@ -4392,6 +4392,7 @@ module MakeImpl Lang> { Typ getTyp(DataFlowType t) { result = t } bindingset[c, tail] + pragma[inline_late] Ap apCons(Content c, Ap tail) { result.isCons(c, tail) } class ApHeadContent = Content; @@ -4461,6 +4462,7 @@ module MakeImpl Lang> { abstract Content getHead(); /** Holds if this is a representation of `head` followed by `tail`. */ + pragma[nomagic] abstract predicate isCons(Content head, AccessPath tail); /** Gets the front of this access path. */