From 133845e41556803743fbc1f76e7fce54941f20a1 Mon Sep 17 00:00:00 2001 From: yoff Date: Tue, 1 Sep 2026 13:57:15 +0200 Subject: [PATCH] Cache Python shared CFG node mapping The canonical injects-to-Python-AST mapping is evaluated repeatedly across DCA prewarm and target stages. Cache getNode so this truthful mapping forms a reusable evaluation boundary without changing its semantics. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 857236eb-3350-48ba-9bf1-6bf5a387191b --- python/ql/lib/semmle/python/controlflow/internal/Cfg.qll | 1 + 1 file changed, 1 insertion(+) diff --git a/python/ql/lib/semmle/python/controlflow/internal/Cfg.qll b/python/ql/lib/semmle/python/controlflow/internal/Cfg.qll index 6dcdb021195b..42c834e17aff 100644 --- a/python/ql/lib/semmle/python/controlflow/internal/Cfg.qll +++ b/python/ql/lib/semmle/python/controlflow/internal/Cfg.qll @@ -35,6 +35,7 @@ private import codeql.controlflow.SuccessorType */ class ControlFlowNode extends CfgImpl::ControlFlowNode { /** Gets the syntactic element corresponding to this flow node, if any. */ + cached Py::AstNode getNode() { exists(CfgImpl::Ast::AstNode n | this.injects(n) | result = CfgImpl::astNodeToPyNode(n)) }