]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-128955: Fix goto if tlbc creation fails when throwing into a generator (#128957)
authormpage <mpage@meta.com>
Fri, 17 Jan 2025 20:53:29 +0000 (12:53 -0800)
committerGitHub <noreply@github.com>
Fri, 17 Jan 2025 20:53:29 +0000 (12:53 -0800)
We don't have the correct copy of the bytecode and can't update next_instr
appropriately, so just unwind.

Python/ceval.c

index e0362c3c89fe6a3a2c95646c5ba071b1a4ed09a2..28b0b4c6de39a793a0e0a1b6370e2464bf12c3c9 100644 (file)
@@ -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;