77
88import regexp.RegExpTreeView // re-export
99private import regexp.internal.ParseRegExp
10- private import regexp.internal.RegExpConfiguration
10+ private import regexp.internal.RegExpConfiguration as RegExpConfiguration // TODO: other name?
1111private import codeql.ruby.AST as Ast
1212private import codeql.ruby.CFG
1313private import codeql.ruby.DataFlow
@@ -122,7 +122,7 @@ class StdLibRegExpInterpretation extends RegExpInterpretation::Range {
122122 mce .getMethodName ( ) = [ "match" , "match?" ] and
123123 this = mce .getArgument ( 0 ) and
124124 // exclude https://ruby-doc.org/core-2.4.0/Regexp.html#method-i-match
125- not mce .getReceiver ( ) = trackRegexpType ( )
125+ not mce .getReceiver ( ) = RegExpConfiguration :: trackRegexpType ( )
126126 )
127127 }
128128}
@@ -132,9 +132,7 @@ class StdLibRegExpInterpretation extends RegExpInterpretation::Range {
132132 * as a part of a regular expression.
133133 */
134134cached
135- DataFlow:: Node regExpSource ( DataFlow:: Node re ) {
136- exists ( RegExpConfiguration c | c .hasFlow ( result , re ) )
137- }
135+ DataFlow:: Node regExpSource ( DataFlow:: Node re ) { result = RegExpConfiguration:: regExpSource ( re ) }
138136
139137/**
140138 * Holds if `exec` is a node where `regexp` is interpreted as a regular expression and
@@ -173,7 +171,7 @@ private predicate regexExecution(
173171 // also see `StdLibRegExpInterpretation`
174172 not (
175173 call .getMethodName ( ) = [ "match" , "match?" ] and
176- call .getReceiver ( ) = trackRegexpType ( )
174+ call .getReceiver ( ) = RegExpConfiguration :: trackRegexpType ( )
177175 )
178176 )
179177 or
0 commit comments