Skip to content

Commit 7ca7882

Browse files
mpagesrinivasreddy
authored andcommitted
pythongh-128955: Fix goto if tlbc creation fails when throwing into a generator (python#128957)
We don't have the correct copy of the bytecode and can't update next_instr appropriately, so just unwind.
1 parent d42d098 commit 7ca7882

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/ceval.c

Lines changed: 1 addition & 1 deletion
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)