]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix issue 34551 - remove redundant store (#9009)
authorEric Lippert <eric@lippert.com>
Mon, 22 Oct 2018 15:52:46 +0000 (08:52 -0700)
committerŁukasz Langa <lukasz@langa.pl>
Mon, 22 Oct 2018 15:52:46 +0000 (16:52 +0100)
The assignment of i/2 to nk is redundant because on this code path, nk is already the size of the dictionary, and i is already twice the size of the dictionary. I've replaced the store with an assertion that i/2 is nk.

Objects/call.c

index 1937a8b2278e85bb62379f685bf40253d68fed61..bda05738755a5e13c0860c54f62fad4b82050201 100644 (file)
@@ -352,7 +352,7 @@ _PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs
             Py_INCREF(k[i+1]);
             i += 2;
         }
-        nk = i / 2;
+        assert(i / 2 == nk);
     }
     else {
         kwtuple = NULL;