Skip to content

Commit

Permalink
Handle out of memory errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mpage committed Sep 13, 2024
1 parent d34adeb commit 6d4fe73
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Include/internal/pycore_opcode_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Include/internal/pycore_uop_metadata.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Python/bytecodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ dummy_func(
op(_LOAD_BYTECODE, (--)) {
#ifdef Py_GIL_DISABLED
_Py_CODEUNIT *bytecode = _PyEval_GetExecutableCode(_PyFrame_GetCode(frame));
ERROR_IF(bytecode == NULL, error);
if (frame->bytecode != bytecode) {
int off = this_instr - frame->bytecode;
frame->bytecode = bytecode;
Expand Down Expand Up @@ -222,6 +223,7 @@ dummy_func(
DEOPT_IF(eval_breaker != version);
#ifdef Py_GIL_DISABLED
_Py_CODEUNIT *bytecode = _PyEval_GetExecutableCode(_PyFrame_GetCode(frame));
ERROR_IF(bytecode == NULL, error);
if (frame->bytecode != bytecode) {
/* Avoid using this_instr here so that _RESUME_CHECK can be included
in traces.
Expand Down
3 changes: 3 additions & 0 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,9 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, _PyInterpreterFrame *frame, int
/* Load thread-local bytecode */
_Py_CODEUNIT *bytecode =
_PyEval_GetExecutableCode(_PyFrame_GetCode(frame));
if (bytecode == NULL) {
goto error;
}
if (frame->bytecode != bytecode) {
int off = frame->instr_ptr - frame->bytecode;
frame->bytecode = bytecode;
Expand Down
1 change: 1 addition & 0 deletions Python/executor_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Python/generated_cases.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6d4fe73

Please sign in to comment.