diff options
| author | Brandt Bucher <brandtbucher@microsoft.com> | 2023-08-09 19:14:50 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-09 19:14:50 (GMT) |
| commit | 326f0ba1c5dda1d9613dbba11ea2470654b0d9c8 (patch) | |
| tree | b027ca457364470c9b72194034bd939080416912 /Python/executor_cases.c.h | |
| parent | a9caf9cf9041d6d0b69f8be0fd778dd1f9b50e74 (diff) | |
| download | cpython-326f0ba1c5dda1d9613dbba11ea2470654b0d9c8.zip cpython-326f0ba1c5dda1d9613dbba11ea2470654b0d9c8.tar.gz cpython-326f0ba1c5dda1d9613dbba11ea2470654b0d9c8.tar.bz2 | |
GH-106485: Dematerialize instance dictionaries when possible (GH-106539)
Diffstat (limited to 'Python/executor_cases.c.h')
| -rw-r--r-- | Python/executor_cases.c.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index d6d541a..a7b5054 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -1623,8 +1623,10 @@ owner = stack_pointer[-1]; assert(Py_TYPE(owner)->tp_dictoffset < 0); assert(Py_TYPE(owner)->tp_flags & Py_TPFLAGS_MANAGED_DICT); - PyDictOrValues dorv = *_PyObject_DictOrValuesPointer(owner); - DEOPT_IF(!_PyDictOrValues_IsValues(dorv), LOAD_ATTR); + PyDictOrValues *dorv = _PyObject_DictOrValuesPointer(owner); + DEOPT_IF(!_PyDictOrValues_IsValues(*dorv) && + !_PyObject_MakeInstanceAttributesFromDict(owner, dorv), + LOAD_ATTR); break; } |
