Skip to content

Commit b8711fc

Browse files
committed
JS: Extend RegExpTerm in ReDoS
1 parent b6c1c17 commit b8711fc

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

javascript/ql/src/Performance/ReDoS.ql

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ import javascript
8383
* A branch in a disjunction that is the root node in a literal, or a literal
8484
* whose root node is not a disjunction.
8585
*/
86-
class RegExpRoot extends @regexpterm {
86+
class RegExpRoot extends RegExpTerm {
8787
RegExpParent parent;
8888

8989
// RegExpTerm is abstract, so do not extend it.
@@ -94,9 +94,9 @@ class RegExpRoot extends @regexpterm {
9494
parent = alt.getParent()
9595
)
9696
or
97-
this.(RegExpTerm).isRootTerm() and
97+
this.isRootTerm() and
9898
not this instanceof RegExpAlt and
99-
parent = this.(RegExpTerm).getParent()
99+
parent = this.getParent()
100100
}
101101

102102
/**
@@ -114,8 +114,6 @@ class RegExpRoot extends @regexpterm {
114114
parent.(StringLiteral).flow() instanceof RegExpPatternSource
115115
)
116116
}
117-
118-
string toString() { result = this.(RegExpTerm).toString() }
119117
}
120118

121119
/**

0 commit comments

Comments
 (0)