Skip to content

Commit dfbb744

Browse files
committed
Python: Add comment on *args argument handling
1 parent e5e5d84 commit dfbb744

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,9 @@ predicate normalCallArg(CallNode call, Node arg, ArgumentPosition apos) {
10901090
exists(int index |
10911091
apos.isStarArgs(index) and
10921092
arg.asCfgNode() = call.getStarArg() and
1093+
// since `CallNode.getArg` doesn't include `*args`, we need to drop to the AST level
1094+
// to get the index. Notice that we only use the AST for getting the index, so we
1095+
// don't need to check for dominance in regards to splitting.
10931096
call.getStarArg().getNode() = call.getNode().getPositionalArg(index).(Starred).getValue()
10941097
)
10951098
or

0 commit comments

Comments
 (0)