Skip to content

Commit 160fa14

Browse files
committed
move InfiniteRepetitionQuantifier to Regexp.qll
1 parent e60628d commit 160fa14

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

javascript/ql/src/semmle/javascript/Regexp.qll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,19 @@ class RegExpQuantifier extends RegExpTerm, @regexp_quantifier {
191191
predicate isGreedy() { is_greedy(this) }
192192
}
193193

194+
/**
195+
* A regular expression term that permits unlimited repetitions.
196+
*/
197+
class InfiniteRepetitionQuantifier extends RegExpQuantifier {
198+
InfiniteRepetitionQuantifier() {
199+
this instanceof RegExpPlus
200+
or
201+
this instanceof RegExpStar
202+
or
203+
this instanceof RegExpRange and not exists(this.(RegExpRange).getUpperBound())
204+
}
205+
}
206+
194207
/**
195208
* An escaped regular expression term, that is, a regular expression
196209
* term starting with a backslash.

javascript/ql/src/semmle/javascript/security/performance/ReDoSUtil.qll

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,6 @@ private predicate isReDoSCandidate(State state, string pump) {
5353
)
5454
}
5555

56-
/**
57-
* A regular expression term that permits unlimited repetitions.
58-
*/
59-
class InfiniteRepetitionQuantifier extends RegExpQuantifier {
60-
InfiniteRepetitionQuantifier() {
61-
this instanceof RegExpPlus
62-
or
63-
this instanceof RegExpStar
64-
or
65-
this instanceof RegExpRange and not exists(this.(RegExpRange).getUpperBound())
66-
}
67-
}
68-
6956
/**
7057
* Gets the char after `c` (from a simplified ASCII table).
7158
*/

0 commit comments

Comments
 (0)