@@ -1537,16 +1537,19 @@ private class DirectRegex extends DataFlow::CallCfgNode, RegexExecution::Range {
15371537 override DataFlow:: Node getString ( ) {
15381538 result in [ this .getArg ( stringArg ( method ) ) , this .getArgByName ( "string" ) ]
15391539 }
1540+
1541+ override string getName ( ) { result = "re." + method }
15401542}
15411543
15421544/** Helper module for tracking compiled regexes. */
15431545private module CompiledRegexes {
1544- private import semmle.python.dataflow.new.DataFlow2
1546+ private import semmle.python.dataflow.new.DataFlow4
15451547 private import semmle.python.RegexTreeView
15461548
1547- // TODO: This module should be refactored once API graphs are more expressinve.
1549+ // TODO: This module should be refactored once API graphs are more expressive.
1550+ // For now it uses data flow, so we pick the verion with least change of collision (4) .
15481551 /** A configuration for finding uses of compiled regexes. */
1549- class RegexDefinitionConfiguration extends DataFlow2 :: Configuration {
1552+ class RegexDefinitionConfiguration extends DataFlow4 :: Configuration {
15501553 RegexDefinitionConfiguration ( ) { this = "RegexDefinitionConfiguration" }
15511554
15521555 override predicate isSource ( DataFlow:: Node source ) { source instanceof RegexDefinitonSource }
@@ -1608,7 +1611,7 @@ private import CompiledRegexes
16081611 *
16091612 * See https://docs.python.org/3/library/re.html#regular-expression-objects
16101613 */
1611- private class CompiledRegex extends DataFlow:: CallCfgNode , RegexExecution {
1614+ private class CompiledRegex extends DataFlow:: CallCfgNode , RegexExecution:: Range {
16121615 DataFlow:: Node regexNode ;
16131616 RegexExecutionMethod method ;
16141617
@@ -1628,6 +1631,8 @@ private class CompiledRegex extends DataFlow::CallCfgNode, RegexExecution {
16281631 override DataFlow:: Node getString ( ) {
16291632 result in [ this .getArg ( stringArg ( method ) - 1 ) , this .getArgByName ( "string" ) ]
16301633 }
1634+
1635+ override string getName ( ) { result = "re." + method }
16311636}
16321637
16331638/**
0 commit comments