diff options
author | Ken Jin <kenjin@python.org> | 2024-12-31 12:24:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-31 12:24:17 +0800 |
commit | 7ef49074123511003c8b7f7f3ba2a4e05285e8dc (patch) | |
tree | 1719d0d2fd187f79bd1398b9f230bb5a65c9502e /Python/executor_cases.c.h | |
parent | dafe7a44630aa32bb411cceb45c7b7df725e3fe3 (diff) | |
download | cpython-7ef49074123511003c8b7f7f3ba2a4e05285e8dc.tar.gz cpython-7ef49074123511003c8b7f7f3ba2a4e05285e8dc.zip |
gh-128262: Allow specialization of calls to classes with __slots__ (GH-128263)
Diffstat (limited to 'Python/executor_cases.c.h')
-rw-r--r-- | Python/executor_cases.c.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Python/executor_cases.c.h b/Python/executor_cases.c.h index 22335021faa..f7374d52705 100644 --- a/Python/executor_cases.c.h +++ b/Python/executor_cases.c.h @@ -4572,7 +4572,9 @@ UOP_STAT_INC(uopcode, miss); JUMP_TO_JUMP_TARGET(); } - assert(tp->tp_flags & Py_TPFLAGS_INLINE_VALUES); + assert(tp->tp_new == PyBaseObject_Type.tp_new); + assert(tp->tp_flags & Py_TPFLAGS_HEAPTYPE); + assert(tp->tp_alloc == PyType_GenericAlloc); PyHeapTypeObject *cls = (PyHeapTypeObject *)callable_o; PyFunctionObject *init_func = (PyFunctionObject *)FT_ATOMIC_LOAD_PTR_ACQUIRE(cls->_spec_cache.init); PyCodeObject *code = (PyCodeObject *)init_func->func_code; @@ -4581,7 +4583,9 @@ JUMP_TO_JUMP_TARGET(); } STAT_INC(CALL, hit); - PyObject *self_o = _PyType_NewManagedObject(tp); + _PyFrame_SetStackPointer(frame, stack_pointer); + PyObject *self_o = PyType_GenericAlloc(tp, 0); + stack_pointer = _PyFrame_GetStackPointer(frame); if (self_o == NULL) { JUMP_TO_ERROR(); } |