mirror of
https://github.com/github/codeql.git
synced 2026-05-03 04:39:29 +02:00
JS: Add recursion guard test
This commit is contained in:
@@ -34,7 +34,11 @@ private import semmle.javascript.internal.CachedStages
|
||||
* ```
|
||||
*/
|
||||
class SourceNode extends DataFlow::Node {
|
||||
SourceNode() { this instanceof SourceNode::Range }
|
||||
SourceNode() {
|
||||
this instanceof SourceNode::Range
|
||||
or
|
||||
none() and this instanceof SourceNode::Internal::RecursionGuard
|
||||
}
|
||||
|
||||
/**
|
||||
* Holds if this node flows into `sink` in zero or more local (that is,
|
||||
@@ -329,6 +333,12 @@ module SourceNode {
|
||||
DataFlow::functionReturnNode(this, _)
|
||||
}
|
||||
}
|
||||
|
||||
/** INTERNAL. DO NOT USE. */
|
||||
module Internal {
|
||||
/** An empty class that some tests are using to enforce that SourceNode is non-recursive. */
|
||||
abstract class RecursionGuard extends DataFlow::Node {}
|
||||
}
|
||||
}
|
||||
|
||||
deprecated class DefaultSourceNode extends SourceNode {
|
||||
|
||||
Reference in New Issue
Block a user