]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-29864: Don't use Py_SIZE for dict object. (#747) (#750)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 22 Mar 2017 05:45:23 +0000 (07:45 +0200)
committerGitHub <noreply@github.com>
Wed, 22 Mar 2017 05:45:23 +0000 (07:45 +0200)
Objects/dictobject.c

index a0c1977037b9e6bb78158587b21a0e3aa248d7d3..8bcc931148beaadb570d2d31f61c4252528e6274 100644 (file)
@@ -1929,7 +1929,7 @@ _PyDict_FromKeys(PyObject *cls, PyObject *iterable, PyObject *value)
             PyObject *key;
             Py_hash_t hash;
 
-            if (dictresize(mp, ESTIMATE_SIZE(Py_SIZE(iterable)))) {
+            if (dictresize(mp, ESTIMATE_SIZE(((PyDictObject *)iterable)->ma_used))) {
                 Py_DECREF(d);
                 return NULL;
             }