mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
9f27dd3e16
commit
25104949a5
1 changed files with 1 additions and 1 deletions
|
@ -1297,7 +1297,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag)
|
|||
co->co_opcache_flag++;
|
||||
if (co->co_opcache_flag == OPCACHE_MIN_RUNS) {
|
||||
if (_PyCode_InitOpcache(co) < 0) {
|
||||
return NULL;
|
||||
goto exit_eval_frame;
|
||||
}
|
||||
#if OPCACHE_STATS
|
||||
opcache_code_objects_extra_mem +=
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue