File tree Expand file tree Collapse file tree
python/ql/src/experimental/semmle/python/frameworks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ private module Re {
3131
3232 override DataFlow:: Node getRegexNode ( ) { result = regexNode }
3333
34+ // pending obj.this discussion
3435 override DataFlow:: CallCfgNode getRegexMethod ( ) { result = regexMethod }
3536 }
3637
@@ -39,13 +40,13 @@ private module Re {
3940 DataFlow:: CallCfgNode regexMethod ;
4041
4142 CompiledRegex ( ) {
42- exists ( DataFlow:: CallCfgNode patternCall , DirectRegex reMethod |
43- this = reMethod and
43+ exists ( DataFlow:: CallCfgNode patternCall , DataFlow :: AttrRead reMethod |
44+ this . getFunction ( ) = reMethod and
4445 patternCall = API:: moduleImport ( "re" ) .getMember ( "compile" ) .getACall ( ) and
45- patternCall = reMethod .( DataFlow:: AttrRead ) .getObject ( ) .getALocalSource ( ) and
46+ patternCall = reMethod .getObject ( ) .getALocalSource ( ) and
47+ reMethod .getAttributeName ( ) instanceof ReMethods and
4648 regexNode = patternCall .getArg ( 0 ) and
47- // regexMethod is *not* worked out outside class instanciation because `CompiledRegex` focuses on re.compile(pattern).ReMethod
48- regexMethod = reMethod .getRegexMethod ( )
49+ regexMethod = this
4950 )
5051 }
5152
You can’t perform that action at this time.
0 commit comments