Skip to content

Commit

Permalink
pythongh-128955: Fix goto if tlbc creation fails when throwing into a…
Browse files Browse the repository at this point in the history
… generator (python#128957)

We don't have the correct copy of the bytecode and can't update next_instr
appropriately, so just unwind.
  • Loading branch information
mpage authored Jan 17, 2025
1 parent d95ba9f commit 13c4def
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 13c4def

Please sign in to comment.