@@ -1537,16 +1537,19 @@ private class DirectRegex extends DataFlow::CallCfgNode, RegexExecution::Range {
1537
1537
override DataFlow:: Node getString ( ) {
1538
1538
result in [ this .getArg ( stringArg ( method ) ) , this .getArgByName ( "string" ) ]
1539
1539
}
1540
+
1541
+ override string getName ( ) { result = "re." + method }
1540
1542
}
1541
1543
1542
1544
/** Helper module for tracking compiled regexes. */
1543
1545
private module CompiledRegexes {
1544
- private import semmle.python.dataflow.new.DataFlow2
1546
+ private import semmle.python.dataflow.new.DataFlow4
1545
1547
private import semmle.python.RegexTreeView
1546
1548
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) .
1548
1551
/** A configuration for finding uses of compiled regexes. */
1549
- class RegexDefinitionConfiguration extends DataFlow2 :: Configuration {
1552
+ class RegexDefinitionConfiguration extends DataFlow4 :: Configuration {
1550
1553
RegexDefinitionConfiguration ( ) { this = "RegexDefinitionConfiguration" }
1551
1554
1552
1555
override predicate isSource ( DataFlow:: Node source ) { source instanceof RegexDefinitonSource }
@@ -1608,7 +1611,7 @@ private import CompiledRegexes
1608
1611
*
1609
1612
* See https://docs.python.org/3/library/re.html#regular-expression-objects
1610
1613
*/
1611
- private class CompiledRegex extends DataFlow:: CallCfgNode , RegexExecution {
1614
+ private class CompiledRegex extends DataFlow:: CallCfgNode , RegexExecution:: Range {
1612
1615
DataFlow:: Node regexNode ;
1613
1616
RegexExecutionMethod method ;
1614
1617
@@ -1628,6 +1631,8 @@ private class CompiledRegex extends DataFlow::CallCfgNode, RegexExecution {
1628
1631
override DataFlow:: Node getString ( ) {
1629
1632
result in [ this .getArg ( stringArg ( method ) - 1 ) , this .getArgByName ( "string" ) ]
1630
1633
}
1634
+
1635
+ override string getName ( ) { result = "re." + method }
1631
1636
}
1632
1637
1633
1638
/**
0 commit comments