Skip to content

Commit 7328f26

Browse files
committed
Python: Fix reachability-related test failures
1 parent 21e74a3 commit 7328f26

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

python/ql/lib/semmle/python/dataflow/old/Implementation.qll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ class TaintTrackingImplementation extends string instanceof TaintTracking::Confi
256256
TaintKind kind, string edgeLabel
257257
) {
258258
this.unprunedStep(src, node, context, path, kind, edgeLabel) and
259-
node.getBasicBlock().likelyReachable() and
259+
node.getBasicBlock().(BasicBlockWithPointsTo).likelyReachable() and
260260
not super.isBarrier(node) and
261261
(
262262
not path = TNoAttribute()
@@ -684,7 +684,9 @@ private class EssaTaintTracking extends string instanceof TaintTracking::Configu
684684
TaintTrackingNode src, PhiFunction defn, TaintTrackingContext context, AttributePath path,
685685
TaintKind kind
686686
) {
687-
exists(DataFlow::Node srcnode, BasicBlock pred, EssaVariable predvar, DataFlow::Node phi |
687+
exists(
688+
DataFlow::Node srcnode, BasicBlockWithPointsTo pred, EssaVariable predvar, DataFlow::Node phi
689+
|
688690
src = TTaintTrackingNode_(srcnode, context, path, kind, this) and
689691
defn = phi.asVariable().getDefinition() and
690692
predvar = defn.getInput(pred) and

python/ql/src/Functions/ConsistentReturns.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313

1414
import python
15+
private import LegacyPointsTo
1516

1617
predicate explicitly_returns_non_none(Function func) {
1718
exists(Return return |
@@ -21,7 +22,7 @@ predicate explicitly_returns_non_none(Function func) {
2122
}
2223

2324
predicate has_implicit_return(Function func) {
24-
exists(ControlFlowNode fallthru |
25+
exists(ControlFlowNodeWithPointsTo fallthru |
2526
fallthru = func.getFallthroughNode() and not fallthru.unlikelyReachable()
2627
)
2728
or

0 commit comments

Comments
 (0)