]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-142664: fix `PyObject_Hash` invokation post GH-143217 (GH-143223) (#143224)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 27 Dec 2025 14:55:45 +0000 (15:55 +0100)
committerGitHub <noreply@github.com>
Sat, 27 Dec 2025 14:55:45 +0000 (14:55 +0000)
gh-142664: fix `PyObject_Hash` invokation post GH-143217 (GH-143223)
(cherry picked from commit 84fcdbd86ecd81f7cc793e22268a029ac6cf29c2)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Objects/memoryobject.c

index e78f5d110a457f485bf2aeb82d778ff1843ad7ec..2d6c33b2ac1cde30d2cdf662dcb1b3160fbce4df 100644 (file)
@@ -3232,9 +3232,9 @@ memory_hash(PyObject *_self)
             // Prevent 'self' from being freed when computing the item's hash.
             // See https://github.com/python/cpython/issues/142664.
             self->exports++;
-            int rc = PyObject_Hash(view->obj);
+            Py_hash_t h = PyObject_Hash(view->obj);
             self->exports--;
-            if (rc == -1) {
+            if (h == -1) {
                 /* Keep the original error message */
                 return -1;
             }