From d828b0e2d6de619f1c095b2c82a28a4ee138a2a5 Mon Sep 17 00:00:00 2001 From: yoff Date: Tue, 1 Sep 2026 00:33:25 +0200 Subject: [PATCH] Python: cache shared CFG scope Cache the Python-local shared-CFG scope relation after semantic inputs and before staged SSA and dataflow consumers. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 07c775e7-cd7c-4e1c-8d97-5194ffd43e1a --- 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 731f3c4a53a2..6dcdb021195b 100644 --- a/python/ql/lib/semmle/python/controlflow/internal/Cfg.qll +++ b/python/ql/lib/semmle/python/controlflow/internal/Cfg.qll @@ -68,6 +68,7 @@ class ControlFlowNode extends CfgImpl::ControlFlowNode { BasicBlock getBasicBlock() { result = super.getBasicBlock() } /** Gets the scope containing this flow node. */ + cached Py::Scope getScope() { result = super.getEnclosingCallable().asScope() } /** Gets the enclosing module. */