mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
Python: Expand starargs_only test
This commit is contained in:
@@ -1085,6 +1085,7 @@ predicate normalCallArg(CallNode call, Node arg, ArgumentPosition apos) {
|
||||
arg.asCfgNode() = call.getArgByName(name)
|
||||
)
|
||||
or
|
||||
// the first `*args`
|
||||
exists(int index |
|
||||
apos.isStarArgs(index) and
|
||||
arg.asCfgNode() = call.getStarArg() and
|
||||
|
||||
@@ -217,6 +217,10 @@ def test_only_starargs():
|
||||
args = (arg1, arg2, "safe") # $ arg1 arg2 func=starargs_only
|
||||
starargs_only(*args)
|
||||
|
||||
args = (arg1, arg2) # $ arg1 arg2 func=starargs_only
|
||||
more_args = (arg3, arg4)
|
||||
starargs_only(*args, *more_args)
|
||||
|
||||
|
||||
def starargs_mixed(a, *args):
|
||||
SINK1(a)
|
||||
|
||||
Reference in New Issue
Block a user