move InfiniteRepetitionQuantifier to Regexp.qll

This commit is contained in:
Erik Krogh Kristensen
2021-04-28 11:39:28 +02:00
parent e60628d463
commit 160fa148f1
2 changed files with 13 additions and 13 deletions

View File

@@ -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.

View File

@@ -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).
*/