mirror of
https://github.com/python/cpython.git
synced 2025-09-03 15:31:08 +00:00
Issue #20437: Fixed 21 potential bugs when deleting objects references.
This commit is contained in:
parent
e9c31470e1
commit
505ff755d7
16 changed files with 34 additions and 63 deletions
|
@ -3049,8 +3049,7 @@ fast_yield:
|
|||
if (call_trace(tstate->c_tracefunc,
|
||||
tstate->c_traceobj, f,
|
||||
PyTrace_RETURN, retval)) {
|
||||
Py_XDECREF(retval);
|
||||
retval = NULL;
|
||||
Py_CLEAR(retval);
|
||||
why = WHY_EXCEPTION;
|
||||
}
|
||||
}
|
||||
|
@ -3068,8 +3067,7 @@ fast_yield:
|
|||
else if (call_trace(tstate->c_profilefunc,
|
||||
tstate->c_profileobj, f,
|
||||
PyTrace_RETURN, retval)) {
|
||||
Py_XDECREF(retval);
|
||||
retval = NULL;
|
||||
Py_CLEAR(retval);
|
||||
/* why = WHY_EXCEPTION; */
|
||||
}
|
||||
}
|
||||
|
@ -3426,8 +3424,7 @@ PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals,
|
|||
if (co->co_flags & CO_GENERATOR) {
|
||||
/* Don't need to keep the reference to f_back, it will be set
|
||||
* when the generator is resumed. */
|
||||
Py_XDECREF(f->f_back);
|
||||
f->f_back = NULL;
|
||||
Py_CLEAR(f->f_back);
|
||||
|
||||
PCALL(PCALL_GENERATOR);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue