Skip to content

Commit ee185ae

Browse files
committed
Python: Move hack from CastNode into flowCheckNodeSpecific
1 parent 5f72ce0 commit ee185ae

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPrivate.qll

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,13 @@ class DataFlowType extends TDataFlowType {
486486

487487
/** A node that performs a type cast. */
488488
class CastNode extends Node {
489+
CastNode() { none() }
490+
}
491+
492+
/**
493+
* Holds if `n` should be a FlowCheckNode, which will appear in path summaries.
494+
*/
495+
predicate flowCheckNodeSpecific(Node n) {
489496
// We include read- and store steps here to force them to be
490497
// shown in path explanations.
491498
// This hack is necessary, because we have included some of these
@@ -494,14 +501,9 @@ class CastNode extends Node {
494501
// We should revert this once, we can remove this steps from the
495502
// default taint steps; this should be possible once we have
496503
// implemented flow summaries and recursive content.
497-
CastNode() { readStep(_, _, this) or storeStep(_, _, this) }
504+
readStep(_, _, n) or storeStep(_, _, n)
498505
}
499506

500-
/**
501-
* Holds if `n` should be a FlowCheckNode, which will appear in path summaries.
502-
*/
503-
predicate flowCheckNodeSpecific(Node n) { none() }
504-
505507
/**
506508
* Holds if `t1` and `t2` are compatible, that is, whether data can flow from
507509
* a node of type `t1` to a node of type `t2`.

0 commit comments

Comments
 (0)