Skip to content

Commit d9fbe58

Browse files
committed
Python: Expand starargs_only test
1 parent 0df3dd6 commit d9fbe58

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1085,6 +1085,7 @@ predicate normalCallArg(CallNode call, Node arg, ArgumentPosition apos) {
10851085
arg.asCfgNode() = call.getArgByName(name)
10861086
)
10871087
or
1088+
// the first `*args`
10881089
exists(int index |
10891090
apos.isStarArgs(index) and
10901091
arg.asCfgNode() = call.getStarArg() and

python/ql/test/experimental/dataflow/coverage/argumentPassing.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ def test_only_starargs():
217217
args = (arg1, arg2, "safe") # $ arg1 arg2 func=starargs_only
218218
starargs_only(*args)
219219

220+
args = (arg1, arg2) # $ arg1 arg2 func=starargs_only
221+
more_args = (arg3, arg4)
222+
starargs_only(*args, *more_args)
223+
220224

221225
def starargs_mixed(a, *args):
222226
SINK1(a)

0 commit comments

Comments
 (0)