From e54b0c8a4ad6c6e958245eb3ea4ecc47e0f97ff0 Mon Sep 17 00:00:00 2001 From: Dino Viehland Date: Thu, 2 May 2024 13:03:29 -0700 Subject: [PATCH] gh-118519: Fix empty weakref list check (#118520) Fix empty list check --- Objects/weakrefobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/weakrefobject.c b/Objects/weakrefobject.c index 93c5fe3aace..88afaec8682 100644 --- a/Objects/weakrefobject.c +++ b/Objects/weakrefobject.c @@ -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; }