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.
This commit is contained in:
mpage 2025-01-17 12:53:29 -08:00 committed by GitHub
parent d95ba9fa11
commit 13c4def692
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View 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;