Skip to content

Commit 36f0d2f

Browse files
committed
JS: Move VarAccessBarrier outside the deprecated Configuration.qll file
1 parent c47419e commit 36f0d2f

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

javascript/ql/lib/semmle/javascript/dataflow/Configuration.qll

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,21 +2001,6 @@ deprecated private class CallAgainstEqualityCheck extends DerivedBarrierGuardNod
20012001
override predicate appliesTo(Configuration cfg) { isBarrierGuardInternal(cfg, prev) }
20022002
}
20032003

2004-
/**
2005-
* A guard node for a variable in a negative condition, such as `x` in `if(!x)`.
2006-
* Can be added to a `isBarrier` in a data-flow configuration to block flow through such checks.
2007-
*/
2008-
class VarAccessBarrier extends DataFlow::Node {
2009-
VarAccessBarrier() {
2010-
exists(ConditionGuardNode guard, SsaRefinementNode refinement |
2011-
this = DataFlow::ssaDefinitionNode(refinement) and
2012-
refinement.getGuard() = guard and
2013-
guard.getTest() instanceof VarAccess and
2014-
guard.getOutcome() = false
2015-
)
2016-
}
2017-
}
2018-
20192004
/**
20202005
* Holds if there is a path without unmatched return steps from `source` to `sink`.
20212006
*/

javascript/ql/lib/semmle/javascript/dataflow/Nodes.qll

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1708,3 +1708,18 @@ class RegExpCreationNode extends DataFlow::SourceNode {
17081708
result = this.getAReference(DataFlow::TypeTracker::end())
17091709
}
17101710
}
1711+
1712+
/**
1713+
* A guard node for a variable in a negative condition, such as `x` in `if(!x)`.
1714+
* Can be added to a `isBarrier` in a data-flow configuration to block flow through such checks.
1715+
*/
1716+
class VarAccessBarrier extends DataFlow::Node {
1717+
VarAccessBarrier() {
1718+
exists(ConditionGuardNode guard, SsaRefinementNode refinement |
1719+
this = DataFlow::ssaDefinitionNode(refinement) and
1720+
refinement.getGuard() = guard and
1721+
guard.getTest() instanceof VarAccess and
1722+
guard.getOutcome() = false
1723+
)
1724+
}
1725+
}

0 commit comments

Comments
 (0)