Skip to content

Commit fb7107c

Browse files
committed
Python: Make ExtractedArgumentNode local
Explicitly adds a bunch of nodes that were previously (using a global analysis) identified as `ExtractedArgumentNode`s.
1 parent b0e94e8 commit fb7107c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

python/ql/lib/semmle/python/dataflow/new/internal/DataFlowPublic.qll

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,14 @@ abstract class ArgumentNode extends Node {
344344
*/
345345
class ExtractedArgumentNode extends ArgumentNode {
346346
ExtractedArgumentNode() {
347-
// for resolved calls, we need to allow all argument nodes
348-
getCallArg(_, _, _, this, _)
347+
// pre-update nodes for calls
348+
this = any(CallCfgNode c).(PostUpdateNode).getPreUpdateNode()
349+
or
350+
// self parameters in methods
351+
exists(Class c | this.asExpr() = c.getAMethod().getArg(0))
352+
or
353+
// the object part of an attribute expression (which might be a bound method)
354+
this.asCfgNode() = any(AttrNode a).getObject()
349355
or
350356
// for potential summaries we allow all normal call arguments
351357
normalCallArg(_, this, _)

0 commit comments

Comments
 (0)