Skip to content

Commit a1c2f4c

Browse files
authored
Python: Small rewrite of **kwargs getParameter logic
1 parent cef933f commit a1c2f4c

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -351,15 +351,10 @@ abstract class DataFlowFunction extends DataFlowCallable, TFunction {
351351
// synthetic to the real. It might seem more natural to do it in the other
352352
// direction, but since we have a clearStep on the real **kwargs parameter, we that
353353
// content-clearing would also affect the synthetic parameter, which we don't want.
354-
(
355-
not exists(func.getArgByName(_)) and
356-
ppos.isDictSplat() and
357-
result.getParameter() = func.getKwarg()
358-
or
359-
exists(func.getArgByName(_)) and
360-
ppos.isDictSplat() and
361-
result = TSynthDictSplatParameterNode(this)
362-
)
354+
ppos.isDictSplat() and
355+
if exists(func.getArgByName(_))
356+
then result = TSynthDictSplatParameterNode(this)
357+
else result.getParameter() = func.getKwarg()
363358
}
364359
}
365360

0 commit comments

Comments
 (0)