mirror of
https://github.com/python/cpython.git
synced 2025-07-19 17:25:54 +00:00
bpo-42266: Handle monkey-patching descriptors in LOAD_ATTR cache (GH-23157)
This commit is contained in:
parent
178695b7ae
commit
80449f243b
4 changed files with 28 additions and 7 deletions
|
@ -3179,7 +3179,6 @@ main_loop:
|
|||
if (co_opcache != NULL && /* co_opcache can be NULL after a DEOPT() call. */
|
||||
type->tp_getattro == PyObject_GenericGetAttr)
|
||||
{
|
||||
PyObject *descr;
|
||||
Py_ssize_t ret;
|
||||
|
||||
if (type->tp_dictoffset > 0) {
|
||||
|
@ -3190,12 +3189,7 @@ main_loop:
|
|||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
descr = _PyType_Lookup(type, name);
|
||||
if (descr == NULL ||
|
||||
Py_TYPE(descr)->tp_descr_get == NULL ||
|
||||
!PyDescr_IsData(descr))
|
||||
{
|
||||
if (_PyType_Lookup(type, name) == NULL) {
|
||||
dictptr = (PyObject **) ((char *)owner + type->tp_dictoffset);
|
||||
dict = *dictptr;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue