From 99745841020da7aadf0a245dd4609d01cdb301ff Mon Sep 17 00:00:00 2001 From: Taus Date: Mon, 20 Apr 2026 11:50:51 +0000 Subject: [PATCH] Python: Instantiate CFG module fully Co-authored-by: yoff --- .../controlflow/internal/AstNodeImpl.qll | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/python/ql/lib/semmle/python/controlflow/internal/AstNodeImpl.qll b/python/ql/lib/semmle/python/controlflow/internal/AstNodeImpl.qll index 6fb36ffc115..526733a340a 100644 --- a/python/ql/lib/semmle/python/controlflow/internal/AstNodeImpl.qll +++ b/python/ql/lib/semmle/python/controlflow/internal/AstNodeImpl.qll @@ -390,3 +390,40 @@ module AstSigImpl implements AstSig { boolean getValue() { none() } } } + +private module Cfg0 = Make0; + +private import Cfg0 + +private module Cfg1 = Make1; + +private import Cfg1 + +private module Cfg2 = Make2; + +private import Cfg2 + +private module Input implements InputSig1, InputSig2 { + predicate cfgCachedStageRef() { CfgCachedStage::ref() } + + private newtype TLabel = TNone() + + class Label extends TLabel { + string toString() { result = "label" } + } + + predicate beginAbruptCompletion( + AstSigImpl::AstNode ast, PreControlFlowNode n, AbruptCompletion c, boolean always + ) { + none() + } + + predicate endAbruptCompletion(AstSigImpl::AstNode ast, PreControlFlowNode n, AbruptCompletion c) { + none() + } + + predicate step(PreControlFlowNode n1, PreControlFlowNode n2) { none() } +} + +import CfgCachedStage +import Public