From: mpage Date: Fri, 17 Jan 2025 20:53:29 +0000 (-0800) Subject: gh-128955: Fix goto if tlbc creation fails when throwing into a generator (#128957) X-Git-Tag: v3.14.0a5~390 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=13c4def692228f09df0b30c5f93bc515e89fc77f;p=thirdparty%2FPython%2Fcpython.git gh-128955: Fix goto if tlbc creation fails when throwing into a generator (#128957) We don't have the correct copy of the bytecode and can't update next_instr appropriately, so just unwind. --- diff --git a/Python/ceval.c b/Python/ceval.c index e0362c3c89fe..28b0b4c6de39 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -846,7 +846,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int _Py_CODEUNIT *bytecode = _PyEval_GetExecutableCode(tstate, _PyFrame_GetCode(frame)); if (bytecode == NULL) { - goto error; + goto exit_unwind; } ptrdiff_t off = frame->instr_ptr - _PyFrame_GetBytecode(frame); frame->tlbc_index = ((_PyThreadStateImpl *)tstate)->tlbc_index;