summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDino Viehland <dinoviehland@meta.com>2024-04-19 21:21:01 (GMT)
committerGitHub <noreply@github.com>2024-04-19 21:21:01 (GMT)
commitb45af00bad3449b85c8f54ba7a9474ca1f52de69 (patch)
tree9812158284089930029397b2c649df41e46b951b
parentb624490deedc37d02e5f29d19ff5e222df3a64dd (diff)
downloadcpython-b45af00bad3449b85c8f54ba7a9474ca1f52de69.zip
cpython-b45af00bad3449b85c8f54ba7a9474ca1f52de69.tar.gz
cpython-b45af00bad3449b85c8f54ba7a9474ca1f52de69.tar.bz2
[gh-117657] _Py_MergeZeroLocalRefcount isn't loading ob_ref_shared with strong enough semantics (#118111)
Use acquire for load of ob_ref_shared
-rw-r--r--Objects/object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 214e7c5..73a1927 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -374,7 +374,7 @@ _Py_MergeZeroLocalRefcount(PyObject *op)
assert(op->ob_ref_local == 0);
_Py_atomic_store_uintptr_relaxed(&op->ob_tid, 0);
- Py_ssize_t shared = _Py_atomic_load_ssize_relaxed(&op->ob_ref_shared);
+ Py_ssize_t shared = _Py_atomic_load_ssize_acquire(&op->ob_ref_shared);
if (shared == 0) {
// Fast-path: shared refcount is zero (including flags)
_Py_Dealloc(op);