We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8a3e87f commit 46ca564Copy full SHA for 46ca564
1 file changed
javascript/ql/src/Performance/ReDoS.ql
@@ -734,13 +734,9 @@ predicate step(StatePair q, InputSymbol s1, InputSymbol s2, State r1, State r2)
734
stateInsideBacktracking(r2)
735
}
736
737
-/**
738
- * A list of pairs of input symbols that describe a path in the product automaton
739
- * starting from some fork state.
740
- */
741
-newtype Trace =
+private newtype TTrace =
742
Nil() or
743
- Step(InputSymbol s1, InputSymbol s2, Trace t) {
+ Step(InputSymbol s1, InputSymbol s2, TTrace t) {
744
exists(StatePair p |
745
isReachableFromFork(_, p, t, _) and
746
step(p, s1, s2, _)
@@ -749,6 +745,20 @@ newtype Trace =
749
t = Nil() and isFork(_, s1, s2, _, _)
750
751
747
748
+/**
+ * A list of pairs of input symbols that describe a path in the product automaton
+ * starting from some fork state.
+ */
752
+class Trace extends TTrace {
753
+ string toString() {
754
+ this = Nil() and result = "Nil()"
755
+ or
756
+ exists(InputSymbol s1, InputSymbol s2, Trace t | this = Step(s1, s2, t) |
757
+ result = "Step(" + s1 + ", " + s2 + ", " + t + ")"
758
+ )
759
+ }
760
+}
761
+
762
/**
763
* Gets the minimum char that is matched by both the character classes `c` and `d`.
764
*/
0 commit comments