Python: Fix reachability-related test failures

This commit is contained in:
Taus
2025-10-31 14:22:29 +00:00
parent 21e74a3f01
commit 7328f26311
2 changed files with 6 additions and 3 deletions

View File

@@ -256,7 +256,7 @@ class TaintTrackingImplementation extends string instanceof TaintTracking::Confi
TaintKind kind, string edgeLabel TaintKind kind, string edgeLabel
) { ) {
this.unprunedStep(src, node, context, path, kind, edgeLabel) and this.unprunedStep(src, node, context, path, kind, edgeLabel) and
node.getBasicBlock().likelyReachable() and node.getBasicBlock().(BasicBlockWithPointsTo).likelyReachable() and
not super.isBarrier(node) and not super.isBarrier(node) and
( (
not path = TNoAttribute() not path = TNoAttribute()
@@ -684,7 +684,9 @@ private class EssaTaintTracking extends string instanceof TaintTracking::Configu
TaintTrackingNode src, PhiFunction defn, TaintTrackingContext context, AttributePath path, TaintTrackingNode src, PhiFunction defn, TaintTrackingContext context, AttributePath path,
TaintKind kind 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 src = TTaintTrackingNode_(srcnode, context, path, kind, this) and
defn = phi.asVariable().getDefinition() and defn = phi.asVariable().getDefinition() and
predvar = defn.getInput(pred) and predvar = defn.getInput(pred) and

View File

@@ -12,6 +12,7 @@
*/ */
import python import python
private import LegacyPointsTo
predicate explicitly_returns_non_none(Function func) { predicate explicitly_returns_non_none(Function func) {
exists(Return return | exists(Return return |
@@ -21,7 +22,7 @@ predicate explicitly_returns_non_none(Function func) {
} }
predicate has_implicit_return(Function func) { predicate has_implicit_return(Function func) {
exists(ControlFlowNode fallthru | exists(ControlFlowNodeWithPointsTo fallthru |
fallthru = func.getFallthroughNode() and not fallthru.unlikelyReachable() fallthru = func.getFallthroughNode() and not fallthru.unlikelyReachable()
) )
or or