Python: Move hack from CastNode into flowCheckNodeSpecific

This commit is contained in:
Owen Mansel-Chan
2023-06-14 14:41:16 +01:00
parent 5f72ce0935
commit ee185ae204

View File

@@ -486,6 +486,13 @@ class DataFlowType extends TDataFlowType {
/** A node that performs a type cast. */
class CastNode extends Node {
CastNode() { none() }
}
/**
* Holds if `n` should be a FlowCheckNode, which will appear in path summaries.
*/
predicate flowCheckNodeSpecific(Node n) {
// We include read- and store steps here to force them to be
// shown in path explanations.
// This hack is necessary, because we have included some of these
@@ -494,14 +501,9 @@ class CastNode extends Node {
// We should revert this once, we can remove this steps from the
// default taint steps; this should be possible once we have
// implemented flow summaries and recursive content.
CastNode() { readStep(_, _, this) or storeStep(_, _, this) }
readStep(_, _, n) or storeStep(_, _, n)
}
/**
* Holds if `n` should be a FlowCheckNode, which will appear in path summaries.
*/
predicate flowCheckNodeSpecific(Node n) { none() }
/**
* Holds if `t1` and `t2` are compatible, that is, whether data can flow from
* a node of type `t1` to a node of type `t2`.