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

+1-1
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)