Skip to content

Commit 13c4def

Browse files
authored
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.
1 parent d95ba9f commit 13c4def

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/ceval.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
846846
_Py_CODEUNIT *bytecode =
847847
_PyEval_GetExecutableCode(tstate, _PyFrame_GetCode(frame));
848848
if (bytecode == NULL) {
849-
goto error;
849+
goto exit_unwind;
850850
}
851851
ptrdiff_t off = frame->instr_ptr - _PyFrame_GetBytecode(frame);
852852
frame->tlbc_index = ((_PyThreadStateImpl *)tstate)->tlbc_index;

0 commit comments

Comments
 (0)