]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-119999: Fix potential race condition in `_Py_ExplicitMergeRefcount` (#120000)
authorSam Gross <colesbury@gmail.com>
Tue, 4 Jun 2024 19:26:26 +0000 (15:26 -0400)
committerGitHub <noreply@github.com>
Tue, 4 Jun 2024 19:26:26 +0000 (15:26 -0400)
commit4055577221f5f52af329e87f31d81bb8fb02c504
tree0e1e6057fdf836261969f4f34851ba8b4e94c724
parent109e1082ea92f89d42cd70f2cc7ca6fba6be9bab
gh-119999: Fix potential race condition in `_Py_ExplicitMergeRefcount` (#120000)

We need to write to `ob_ref_local` and `ob_tid` before `ob_ref_shared`.
Once we mark `ob_ref_shared` as merged, some other thread may free the
object because the caller also passes in `-1` as `extra` to give up its
only reference.
Objects/object.c