summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Jin <28750310+Fidget-Spinner@users.noreply.github.com>2021-07-17 11:09:18 (GMT)
committerGitHub <noreply@github.com>2021-07-17 11:09:18 (GMT)
commitf88e138a1aa3b9a9e013963e4fd7d5cce6a0b85c (patch)
tree0422add6f1412aba804ef4f8922f2c5f5920a0ec
parent689b05c6281ee6bafb9a0c0bf291260efa130f64 (diff)
downloadcpython-f88e138a1aa3b9a9e013963e4fd7d5cce6a0b85c.zip
cpython-f88e138a1aa3b9a9e013963e4fd7d5cce6a0b85c.tar.gz
cpython-f88e138a1aa3b9a9e013963e4fd7d5cce6a0b85c.tar.bz2
bpo-20291: Fix MSVC warnings in getargs.c (GH-27211)
* Fix MSVC warnings in getargs.c * apply suggestions Co-Authored-By: Batuhan Taskaya <batuhan@python.org> Co-authored-by: Batuhan Taskaya <batuhan@python.org>
-rw-r--r--Python/getargs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/getargs.c b/Python/getargs.c
index 330f2b4..3fab3b5 100644
--- a/Python/getargs.c
+++ b/Python/getargs.c
@@ -2552,7 +2552,8 @@ _PyArg_UnpackKeywordsWithVararg(PyObject *const *args, Py_ssize_t nargs,
}
/* copy keyword args using kwtuple to drive process */
- for (i = Py_MAX((int)nargs, posonly) - varargssize; i < maxargs; i++) {
+ for (i = Py_MAX((int)nargs, posonly) -
+ Py_SAFE_DOWNCAST(varargssize, Py_ssize_t, int); i < maxargs; i++) {
if (nkwargs) {
keyword = PyTuple_GET_ITEM(kwtuple, i - posonly);
if (kwargs != NULL) {