[3.13] gh-119999: Fix potential race condition in `_Py_ExplicitMergeRefcount` (GH-120000) (#120073)
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. (cherry picked from commit 4055577221f5f52af329e87f31d81bb8fb02c504) Co-authored-by: Sam Gross <colesbury@gmail.com>
M
Miss Islington (bot) committed
327a36a4f98466e734bf3b10994290fceab8fdd2
Parent: 7edc6bd
Committed by GitHub <noreply@github.com>
on 6/4/2024, 7:57:18 PM