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

Skip to content

Commit d9df63d

Browse files
authored
bpo-40048: Fix _PyCode_InitOpcache() error path (GH-19691) (GH-19698)
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. (cherry picked from commit 2510494)
1 parent 3340b2a commit d9df63d

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
@@ -1159,7 +1159,7 @@ _PyEval_EvalFrameDefault(PyFrameObject *f, int throwflag)
11591159
co->co_opcache_flag++;
11601160
if (co->co_opcache_flag == OPCACHE_MIN_RUNS) {
11611161
if (_PyCode_InitOpcache(co) < 0) {
1162-
return NULL;
1162+
goto exit_eval_frame;
11631163
}
11641164
#if OPCACHE_STATS
11651165
opcache_code_objects_extra_mem +=

0 commit comments

Comments
 (0)
0