8000 bpo-40048: Fix _PyCode_InitOpcache() error path (GH-19691) · python/cpython@2510494 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2510494

Browse files
authored
bpo-40048: Fix _PyCode_InitOpcache() error path (GH-19691)
If _PyCode_InitOpcache() fails in _PyEval_EvalFrameDefault(), use "goto exit_eval_frame;" rather than "return NULL;" to exit the function in a consistent state. For example, tstate->frame is now reset properly.
1 parent 9f27dd3 commit 2510494

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
@@ -1297,7 +1297,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
12971297
co->co_opcache_flag++;
12981298
if (co->co_opcache_flag == OPCACHE_MIN_RUNS) {
12991299
if (_PyCode_InitOpcache(co) < 0) {
1300-
return NULL;
1300+
goto exit_eval_frame;
13011301
}
13021302
#if OPCACHE_STATS
13031303
opcache_code_objects_extra_mem +=

0 commit comments

Comments
 (0)
0