mirror of
https://github.com/python/cpython.git
synced 2025-09-02 15:07:53 +00:00
Issue #20437: Fixed 22 potential bugs when deleting objects references.
This commit is contained in:
commit
dfe98a102e
15 changed files with 34 additions and 63 deletions
|
@ -3189,8 +3189,7 @@ fast_yield:
|
|||
if (call_trace(tstate->c_tracefunc, tstate->c_traceobj,
|
||||
tstate, f,
|
||||
PyTrace_RETURN, retval)) {
|
||||
Py_XDECREF(retval);
|
||||
retval = NULL;
|
||||
Py_CLEAR(retval);
|
||||
why = WHY_EXCEPTION;
|
||||
}
|
||||
}
|
||||
|
@ -3209,8 +3208,7 @@ fast_yield:
|
|||
else if (call_trace(tstate->c_profilefunc, tstate->c_profileobj,
|
||||
tstate, f,
|
||||
PyTrace_RETURN, retval)) {
|
||||
Py_XDECREF(retval);
|
||||
retval = NULL;
|
||||
Py_CLEAR(retval);
|
||||
/* why = WHY_EXCEPTION; */
|
||||
}
|
||||
}
|
||||
|
@ -3568,8 +3566,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