File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed
python/ql/lib/semmle/python Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -1000,11 +1000,22 @@ class RegExpBackRef extends RegExpTerm, TRegExpBackRef {
10001000
10011001 /** Gets the capture group this back reference refers to. */
10021002 RegExpGroup getGroup ( ) {
1003- result .getLiteral ( ) = this .getLiteral ( ) and
1004- (
1005- result .getNumber ( ) = this .getNumber ( ) or
1006- result .getName ( ) = this .getName ( )
1007- )
1003+ this .hasLiteralAndNumber ( result .getLiteral ( ) , result .getNumber ( ) ) or
1004+ this .hasLiteralAndName ( result .getLiteral ( ) , result .getName ( ) )
1005+ }
1006+
1007+ /** Join-order helper for `getGroup`. */
1008+ pragma [ nomagic]
1009+ private predicate hasLiteralAndNumber ( RegExpLiteral literal , int number ) {
1010+ literal = this .getLiteral ( ) and
1011+ number = this .getNumber ( )
1012+ }
1013+
1014+ /** Join-order helper for `getGroup`. */
1015+ pragma [ nomagic]
1016+ private predicate hasLiteralAndName ( RegExpLiteral literal , string name ) {
1017+ literal = this .getLiteral ( ) and
1018+ name = this .getName ( )
10081019 }
10091020
10101021 override RegExpTerm getChild ( int i ) { none ( ) }
You can’t perform that action at this time.
0 commit comments