Skip to content

Commit 41ee325

Browse files
authored
Python: Clean up Stdlib.qll
Not as many opportunities to clean stuff up here.
1 parent e90ec80 commit 41ee325

File tree

1 file changed

+4
-5
lines changed
  • python/ql/src/experimental/semmle/python/frameworks

1 file changed

+4
-5
lines changed

python/ql/src/experimental/semmle/python/frameworks/Stdlib.qll

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,14 @@ private module Re {
6464
*
6565
* See https://docs.python.org/3/library/re.html#regular-expression-objects
6666
*/
67-
private class CompiledRegex extends DataFlow::CallCfgNode, RegexExecution::Range {
67+
private class CompiledRegex extends DataFlow::MethodCallNode, RegexExecution::Range {
6868
DataFlow::Node regexNode;
6969

7070
CompiledRegex() {
71-
exists(DataFlow::CallCfgNode patternCall, DataFlow::AttrRead reMethod |
72-
this.getFunction() = reMethod and
71+
exists(DataFlow::MethodCallNode patternCall |
7372
patternCall = API::moduleImport("re").getMember("compile").getACall() and
74-
patternCall.flowsTo(reMethod.getObject()) and
75-
reMethod.getAttributeName() instanceof RegexExecutionMethods and
73+
patternCall.flowsTo(this.getReceiver()) and
74+
this.getMethodName() instanceof RegexExecutionMethods and
7675
regexNode = patternCall.getArg(0)
7776
)
7877
}

0 commit comments

Comments
 (0)