|
67 | 67 | * Finally, we build `PathNode`s for all nodes that appear on a path |
68 | 68 | * computed by `onPath`. |
69 | 69 | */ |
| 70 | +deprecated module; |
70 | 71 |
|
71 | 72 | private import javascript |
72 | 73 | private import internal.FlowSteps |
73 | 74 | private import internal.AccessPaths |
74 | 75 | private import semmle.javascript.Unit |
75 | 76 | private import semmle.javascript.internal.CachedStages |
76 | 77 | private import AdditionalFlowSteps |
| 78 | +private import internal.DataFlowPrivate as DataFlowPrivate |
77 | 79 |
|
78 | 80 | /** |
79 | 81 | * A data flow tracking configuration for finding inter-procedural paths from |
@@ -1793,39 +1795,7 @@ deprecated class MidPathNode extends PathNode, MkMidNode { |
1793 | 1795 | * Holds if this node is hidden from paths in path explanation queries, except |
1794 | 1796 | * in cases where it is the source or sink. |
1795 | 1797 | */ |
1796 | | - predicate isHidden() { PathNode::shouldNodeBeHidden(nd) } |
1797 | | -} |
1798 | | - |
1799 | | -/** Companion module to the `PathNode` class. */ |
1800 | | -module PathNode { |
1801 | | - /** Holds if `nd` should be hidden in data flow paths. */ |
1802 | | - predicate shouldNodeBeHidden(DataFlow::Node nd) { |
1803 | | - // TODO: move to DataFlowPrivate |
1804 | | - // Skip phi, refinement, and capture nodes |
1805 | | - nd.(DataFlow::SsaDefinitionNode).getSsaVariable().getDefinition() instanceof |
1806 | | - SsaImplicitDefinition |
1807 | | - or |
1808 | | - // Skip SSA definition of parameter as its location coincides with the parameter node |
1809 | | - nd = DataFlow::ssaDefinitionNode(Ssa::definition(any(SimpleParameter p))) |
1810 | | - or |
1811 | | - // Skip to the top of big left-leaning string concatenation trees. |
1812 | | - nd = any(AddExpr add).flow() and |
1813 | | - nd = any(AddExpr add).getAnOperand().flow() |
1814 | | - or |
1815 | | - // Skip the exceptional return on functions, as this highlights the entire function. |
1816 | | - nd = any(DataFlow::FunctionNode f).getExceptionalReturn() |
1817 | | - or |
1818 | | - // Skip the special return node for functions, as this highlights the entire function (and the returned expr is the previous node). |
1819 | | - nd = any(DataFlow::FunctionNode f).getReturnNode() |
1820 | | - or |
1821 | | - // Skip the synthetic 'this' node, as a ThisExpr will be the next node anyway |
1822 | | - nd = DataFlow::thisNode(_) |
1823 | | - or |
1824 | | - // Skip captured variable nodes as the successor will be a use of that variable anyway. |
1825 | | - nd = DataFlow::capturedVariableNode(_) |
1826 | | - or |
1827 | | - nd instanceof DataFlow::FunctionSelfReferenceNode |
1828 | | - } |
| 1798 | + predicate isHidden() { DataFlowPrivate::nodeIsHidden(nd) } |
1829 | 1799 | } |
1830 | 1800 |
|
1831 | 1801 | /** |
@@ -2031,22 +2001,6 @@ deprecated private class CallAgainstEqualityCheck extends DerivedBarrierGuardNod |
2031 | 2001 | override predicate appliesTo(Configuration cfg) { isBarrierGuardInternal(cfg, prev) } |
2032 | 2002 | } |
2033 | 2003 |
|
2034 | | -/** |
2035 | | - * A guard node for a variable in a negative condition, such as `x` in `if(!x)`. |
2036 | | - * Can be added to a `isBarrier` in a data-flow configuration to block flow through such checks. |
2037 | | - */ |
2038 | | -class VarAccessBarrier extends DataFlow::Node { |
2039 | | - // TODO: This does not work in dataflow2 when the variable is captured, since the capture-flow library bypasses the refinement node. |
2040 | | - VarAccessBarrier() { |
2041 | | - exists(ConditionGuardNode guard, SsaRefinementNode refinement | |
2042 | | - this = DataFlow::ssaDefinitionNode(refinement) and |
2043 | | - refinement.getGuard() = guard and |
2044 | | - guard.getTest() instanceof VarAccess and |
2045 | | - guard.getOutcome() = false |
2046 | | - ) |
2047 | | - } |
2048 | | -} |
2049 | | - |
2050 | 2004 | /** |
2051 | 2005 | * Holds if there is a path without unmatched return steps from `source` to `sink`. |
2052 | 2006 | */ |
|
0 commit comments