]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-118519: Fix empty weakref list check (#118520)
authorDino Viehland <dinoviehland@meta.com>
Thu, 2 May 2024 20:03:29 +0000 (13:03 -0700)
committerGitHub <noreply@github.com>
Thu, 2 May 2024 20:03:29 +0000 (13:03 -0700)
Fix empty list check

Objects/weakrefobject.c

index 93c5fe3aacecfd2390d36808baa87b321366cf15..88afaec86827ed4bd2c0d5448963c60bd63db5c9 100644 (file)
@@ -988,7 +988,7 @@ PyObject_ClearWeakRefs(PyObject *object)
     }
 
     list = GET_WEAKREFS_LISTPTR(object);
-    if (FT_ATOMIC_LOAD_PTR(list) == NULL) {
+    if (FT_ATOMIC_LOAD_PTR(*list) == NULL) {
         // Fast path for the common case
         return;
     }