@@ -163,18 +163,22 @@ private module RegexFlowConfig implements DataFlow::ConfigSig {
163163
164164private module RegexFlow = DataFlow:: Global< RegexFlowConfig > ;
165165
166+ private predicate usedAsRegexImpl ( StringLiteral regex , string mode , boolean match_full_string ) {
167+ RegexFlow:: flow ( DataFlow:: exprNode ( regex ) , _) and
168+ mode = "None" and // TODO: proper mode detection
169+ ( if matchesFullString ( regex ) then match_full_string = true else match_full_string = false )
170+ }
171+
166172/**
167173 * Holds if `regex` is used as a regex, with the mode `mode` (if known).
168174 * If regex mode is not known, `mode` will be `"None"`.
169175 *
170176 * As an optimisation, only regexes containing an infinite repitition quatifier (`+`, `*`, or `{x,}`)
171177 * and therefore may be relevant for ReDoS queries are considered.
172178 */
173- predicate usedAsRegex ( StringLiteral regex , string mode , boolean match_full_string ) {
174- RegexFlow:: flow ( DataFlow:: exprNode ( regex ) , _) and
175- mode = "None" and // TODO: proper mode detection
176- ( if matchesFullString ( regex ) then match_full_string = true else match_full_string = false )
177- }
179+ overlay [ local]
180+ predicate usedAsRegex ( StringLiteral regex , string mode , boolean match_full_string ) =
181+ forceLocal( usedAsRegexImpl / 3 ) ( regex , mode , match_full_string )
178182
179183/**
180184 * Holds if `regex` is used as a regular expression that is matched against a full string,
0 commit comments