mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Python: Fix reachability-related test failures
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user