From 97681ea2191cea11dbbb5d5b620d31682af8d35f Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Fri, 12 Aug 2022 20:27:50 +0200 Subject: [PATCH] simplify code after review --- .../javascript/security/regexp/RegexpMatching.qll | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/javascript/ql/lib/semmle/javascript/security/regexp/RegexpMatching.qll b/javascript/ql/lib/semmle/javascript/security/regexp/RegexpMatching.qll index 694df507931..07dbc41957f 100644 --- a/javascript/ql/lib/semmle/javascript/security/regexp/RegexpMatching.qll +++ b/javascript/ql/lib/semmle/javascript/security/regexp/RegexpMatching.qll @@ -32,14 +32,6 @@ signature predicate isRegexpMatchingCandidateSig( * and the results can be read from the `matches` and `fillsCaptureGroup` predicates. */ module RegexpMatching { - private predicate test(RootTerm reg, string str, boolean ignorePrefix) { - isCandidate(reg, str, ignorePrefix, false) - } - - private predicate testWithGroups(RootTerm reg, string str, boolean ignorePrefix) { - isCandidate(reg, str, ignorePrefix, true) - } - /** * Gets a state the regular expression `reg` can be in after matching the `i`th char in `str`. * The regular expression is modeled as a non-determistic finite automaton, @@ -123,7 +115,7 @@ module RegexpMatching { */ private State getAStateThatReachesAccept(RootTerm reg, int i, string str, boolean ignorePrefix) { // base case, reaches an accepting state from the last state in `getAState(..)` - testWithGroups(reg, str, ignorePrefix) and + isCandidate(reg, str, ignorePrefix, true) and i = str.length() - 1 and result = getAState(reg, i, str, ignorePrefix) and epsilonSucc*(result) = Accept(_)