Skip to content

Commit b45af00

Browse files
authored
[gh-117657] _Py_MergeZeroLocalRefcount isn't loading ob_ref_shared with strong enough semantics (#118111)
Use acquire for load of ob_ref_shared
1 parent b624490 commit b45af00

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Objects/object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ _Py_MergeZeroLocalRefcount(PyObject *op)
374374
assert(op->ob_ref_local == 0);
375375

376376
_Py_atomic_store_uintptr_relaxed(&op->ob_tid, 0);
377-
Py_ssize_t shared = _Py_atomic_load_ssize_relaxed(&op->ob_ref_shared);
377+
Py_ssize_t shared = _Py_atomic_load_ssize_acquire(&op->ob_ref_shared);
378378
if (shared == 0) {
379379
// Fast-path: shared refcount is zero (including flags)
380380
_Py_Dealloc(op);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy