mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-103879: Fix refleak in super specialization (#103882)
This commit is contained in:
parent
1c0a9c5a1c
commit
6c4124d11a
1 changed files with 2 additions and 0 deletions
|
@ -544,8 +544,10 @@ _Py_Specialize_LoadSuperAttr(PyObject *global_super, PyObject *class, PyObject *
|
||||||
write_u32(cache->self_type_version, Py_TYPE(self)->tp_version_tag);
|
write_u32(cache->self_type_version, Py_TYPE(self)->tp_version_tag);
|
||||||
write_obj(cache->method, res); // borrowed
|
write_obj(cache->method, res); // borrowed
|
||||||
instr->op.code = LOAD_SUPER_ATTR_METHOD;
|
instr->op.code = LOAD_SUPER_ATTR_METHOD;
|
||||||
|
Py_DECREF(res);
|
||||||
goto success;
|
goto success;
|
||||||
}
|
}
|
||||||
|
Py_DECREF(res);
|
||||||
SPECIALIZATION_FAIL(LOAD_SUPER_ATTR, SPEC_FAIL_SUPER_NOT_METHOD);
|
SPECIALIZATION_FAIL(LOAD_SUPER_ATTR, SPEC_FAIL_SUPER_NOT_METHOD);
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue