diff --git a/Python/ceval.c b/Python/ceval.c index ab10b4166d6d21..5b1ae377ec33b0 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -94,6 +94,7 @@ static PyObject * special_lookup(PyThreadState *, PyObject *, _Py_Identifier *); static int check_args_iterable(PyThreadState *, PyObject *func, PyObject *vararg); static void format_kwargs_error(PyThreadState *, PyObject *func, PyObject *kwargs); static void format_awaitable_error(PyThreadState *, PyTypeObject *, int, int); +static void unknown_opcode_error(PyThreadState *, PyFrameObject *, int); #define NAME_ERROR_MSG \ "name '%.200s' is not defined" @@ -4418,11 +4419,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) _unknown_opcode: #endif default: - fprintf(stderr, - "XXX lineno: %d, opcode: %d\n", - PyFrame_GetLineNumber(f), - opcode); - _PyErr_SetString(tstate, PyExc_SystemError, "unknown opcode"); + unknown_opcode_error(tstate, f, opcode); goto error; } /* switch */ @@ -6310,6 +6307,16 @@ format_awaitable_error(PyThreadState *tstate, PyTypeObject *type, int prevprevop } } +_Py_NO_INLINE static void +unknown_opcode_error(PyThreadState *tstate, PyFrameObject *f, int opcode) +{ + fprintf(stderr, + "XXX lineno: %d, opcode: %d\n", + PyFrame_GetLineNumber(f), + opcode); + _PyErr_SetString(tstate, PyExc_SystemError, "unknown opcode"); +} + static PyObject * unicode_concatenate(PyThreadState *tstate, PyObject *v, PyObject *w, PyFrameObject *f, const _Py_CODEUNIT *next_instr)