summaryrefslogtreecommitdiffstats
path: root/Python/bytecodes.c
diff options
context:
space:
mode:
authorSavannah Ostrowski <savannah@python.org>2025-12-15 23:18:44 (GMT)
committerGitHub <noreply@github.com>2025-12-15 23:18:44 (GMT)
commitbef63d2fb81ae28760040157ea589541bed47d02 (patch)
treedf24d3b3f0dec554a2f43869ac12db1c9be1e262 /Python/bytecodes.c
parentf277781bba684322dffffe45cd878f4652ccf7e4 (diff)
downloadcpython-bef63d2fb81ae28760040157ea589541bed47d02.zip
cpython-bef63d2fb81ae28760040157ea589541bed47d02.tar.gz
cpython-bef63d2fb81ae28760040157ea589541bed47d02.tar.bz2
GH-134584: Remove redundant refcount from `_STORE_ATTR_SLOT` (#142729)
Diffstat (limited to 'Python/bytecodes.c')
-rw-r--r--Python/bytecodes.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/Python/bytecodes.c b/Python/bytecodes.c
index 8420d09..0dbfe96 100644
--- a/Python/bytecodes.c
+++ b/Python/bytecodes.c
@@ -2640,7 +2640,7 @@ dummy_func(
_GUARD_TYPE_VERSION +
_STORE_ATTR_WITH_HINT;
- op(_STORE_ATTR_SLOT, (index/1, value, owner --)) {
+ op(_STORE_ATTR_SLOT, (index/1, value, owner -- o)) {
PyObject *owner_o = PyStackRef_AsPyObjectBorrow(owner);
DEOPT_IF(!LOCK_OBJECT(owner_o));
@@ -2649,14 +2649,16 @@ dummy_func(
PyObject *old_value = *(PyObject **)addr;
FT_ATOMIC_STORE_PTR_RELEASE(*(PyObject **)addr, PyStackRef_AsPyObjectSteal(value));
UNLOCK_OBJECT(owner_o);
- PyStackRef_CLOSE(owner);
+ INPUTS_DEAD();
+ o = owner;
Py_XDECREF(old_value);
}
macro(STORE_ATTR_SLOT) =
unused/1 +
_GUARD_TYPE_VERSION +
- _STORE_ATTR_SLOT;
+ _STORE_ATTR_SLOT +
+ POP_TOP;
family(COMPARE_OP, INLINE_CACHE_ENTRIES_COMPARE_OP) = {
COMPARE_OP_FLOAT,