Skip to content

Commit c5f29c6

Browse files
committed
Python: Port ConsistentReturns.ql
No test changes.
1 parent c4c797b commit c5f29c6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

python/ql/src/Functions/ConsistentReturns.ql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
import python
15-
private import LegacyPointsTo
15+
private import semmle.python.dataflow.new.internal.DataFlowDispatch
1616

1717
predicate explicitly_returns_non_none(Function func) {
1818
exists(Return return |
@@ -22,8 +22,8 @@ predicate explicitly_returns_non_none(Function func) {
2222
}
2323

2424
predicate has_implicit_return(Function func) {
25-
exists(ControlFlowNodeWithPointsTo fallthru |
26-
fallthru = func.getFallthroughNode() and not fallthru.unlikelyReachable()
25+
exists(ControlFlowNode fallthru |
26+
fallthru = func.getFallthroughNode() and not Reachability::unlikelyReachable(fallthru)
2727
)
2828
or
2929
exists(Return return | return.getScope() = func and not exists(return.getValue()))

0 commit comments

Comments
 (0)