@@ -1584,15 +1584,15 @@ private module StdlibPrivate {
1584
1584
RegexExecutionMethod ( ) {
1585
1585
this in [ "match" , "fullmatch" , "search" , "split" , "findall" , "finditer" , "sub" , "subn" ]
1586
1586
}
1587
- }
1588
1587
1589
- /** Gets the index of the argument representing the string to be searched by a regex. */
1590
- int getStringArgIndex ( RegexExecutionMethod method ) {
1591
- method in [ "match" , "fullmatch" , "search" , "split" , "findall" , "finditer" ] and
1592
- result = 1
1593
- or
1594
- method in [ "sub" , "subn" ] and
1595
- result = 2
1588
+ /** Gets the index of the argument representing the string to be searched by a regex. */
1589
+ int getStringArgIndex ( ) {
1590
+ this in [ "match" , "fullmatch" , "search" , "split" , "findall" , "finditer" ] and
1591
+ result = 1
1592
+ or
1593
+ this in [ "sub" , "subn" ] and
1594
+ result = 2
1595
+ }
1596
1596
}
1597
1597
1598
1598
/**
@@ -1608,7 +1608,7 @@ private module StdlibPrivate {
1608
1608
override DataFlow:: Node getRegex ( ) { result in [ this .getArg ( 0 ) , this .getArgByName ( "pattern" ) ] }
1609
1609
1610
1610
override DataFlow:: Node getString ( ) {
1611
- result in [ this .getArg ( getStringArgIndex ( method ) ) , this .getArgByName ( "string" ) ]
1611
+ result in [ this .getArg ( method . getStringArgIndex ( ) ) , this .getArgByName ( "string" ) ]
1612
1612
}
1613
1613
1614
1614
override string getName ( ) { result = "re." + method }
@@ -1656,17 +1656,17 @@ private module StdlibPrivate {
1656
1656
*/
1657
1657
private class CompiledRegexExecution extends DataFlow:: MethodCallNode , RegexExecution:: Range {
1658
1658
DataFlow:: Node regexNode ;
1659
- RegexExecutionMethod methodName ;
1659
+ RegexExecutionMethod method ;
1660
1660
1661
- CompiledRegexExecution ( ) { this .calls ( compiledRegex ( regexNode ) , methodName ) }
1661
+ CompiledRegexExecution ( ) { this .calls ( compiledRegex ( regexNode ) , method ) }
1662
1662
1663
1663
override DataFlow:: Node getRegex ( ) { result = regexNode }
1664
1664
1665
1665
override DataFlow:: Node getString ( ) {
1666
- result in [ this .getArg ( getStringArgIndex ( methodName ) - 1 ) , this .getArgByName ( "string" ) ]
1666
+ result in [ this .getArg ( method . getStringArgIndex ( ) - 1 ) , this .getArgByName ( "string" ) ]
1667
1667
}
1668
1668
1669
- override string getName ( ) { result = "re." + methodName }
1669
+ override string getName ( ) { result = "re." + method }
1670
1670
}
1671
1671
1672
1672
/**
0 commit comments