From 7328f263116193676cedbdcc0dee95ce64809fa0 Mon Sep 17 00:00:00 2001 From: Taus Date: Fri, 31 Oct 2025 14:22:29 +0000 Subject: [PATCH] Python: Fix reachability-related test failures --- python/ql/lib/semmle/python/dataflow/old/Implementation.qll | 6 ++++-- python/ql/src/Functions/ConsistentReturns.ql | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/python/ql/lib/semmle/python/dataflow/old/Implementation.qll b/python/ql/lib/semmle/python/dataflow/old/Implementation.qll index eb7e5fdc9a5..18020c7d9ff 100644 --- a/python/ql/lib/semmle/python/dataflow/old/Implementation.qll +++ b/python/ql/lib/semmle/python/dataflow/old/Implementation.qll @@ -256,7 +256,7 @@ class TaintTrackingImplementation extends string instanceof TaintTracking::Confi TaintKind kind, string edgeLabel ) { this.unprunedStep(src, node, context, path, kind, edgeLabel) and - node.getBasicBlock().likelyReachable() and + node.getBasicBlock().(BasicBlockWithPointsTo).likelyReachable() and not super.isBarrier(node) and ( not path = TNoAttribute() @@ -684,7 +684,9 @@ private class EssaTaintTracking extends string instanceof TaintTracking::Configu TaintTrackingNode src, PhiFunction defn, TaintTrackingContext context, AttributePath path, TaintKind kind ) { - exists(DataFlow::Node srcnode, BasicBlock pred, EssaVariable predvar, DataFlow::Node phi | + exists( + DataFlow::Node srcnode, BasicBlockWithPointsTo pred, EssaVariable predvar, DataFlow::Node phi + | src = TTaintTrackingNode_(srcnode, context, path, kind, this) and defn = phi.asVariable().getDefinition() and predvar = defn.getInput(pred) and diff --git a/python/ql/src/Functions/ConsistentReturns.ql b/python/ql/src/Functions/ConsistentReturns.ql index 1bc7b5724b3..9beeafc6372 100644 --- a/python/ql/src/Functions/ConsistentReturns.ql +++ b/python/ql/src/Functions/ConsistentReturns.ql @@ -12,6 +12,7 @@ */ import python +private import LegacyPointsTo predicate explicitly_returns_non_none(Function func) { exists(Return return | @@ -21,7 +22,7 @@ predicate explicitly_returns_non_none(Function func) { } predicate has_implicit_return(Function func) { - exists(ControlFlowNode fallthru | + exists(ControlFlowNodeWithPointsTo fallthru | fallthru = func.getFallthroughNode() and not fallthru.unlikelyReachable() ) or