mirror of
https://github.com/github/codeql.git
synced 2025-12-18 01:33:15 +01:00
move InfiniteRepetitionQuantifier to Regexp.qll
This commit is contained in:
@@ -191,6 +191,19 @@ class RegExpQuantifier extends RegExpTerm, @regexp_quantifier {
|
||||
predicate isGreedy() { is_greedy(this) }
|
||||
}
|
||||
|
||||
/**
|
||||
* A regular expression term that permits unlimited repetitions.
|
||||
*/
|
||||
class InfiniteRepetitionQuantifier extends RegExpQuantifier {
|
||||
InfiniteRepetitionQuantifier() {
|
||||
this instanceof RegExpPlus
|
||||
or
|
||||
this instanceof RegExpStar
|
||||
or
|
||||
this instanceof RegExpRange and not exists(this.(RegExpRange).getUpperBound())
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* An escaped regular expression term, that is, a regular expression
|
||||
* term starting with a backslash.
|
||||
|
||||
@@ -53,19 +53,6 @@ private predicate isReDoSCandidate(State state, string pump) {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* A regular expression term that permits unlimited repetitions.
|
||||
*/
|
||||
class InfiniteRepetitionQuantifier extends RegExpQuantifier {
|
||||
InfiniteRepetitionQuantifier() {
|
||||
this instanceof RegExpPlus
|
||||
or
|
||||
this instanceof RegExpStar
|
||||
or
|
||||
this instanceof RegExpRange and not exists(this.(RegExpRange).getUpperBound())
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the char after `c` (from a simplified ASCII table).
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user