Issue #20437: Fixed 22 potential bugs when deleting objects references.

This commit is contained in:
Serhiy Storchaka 2014-02-09 13:46:20 +02:00
commit dfe98a102e
15 changed files with 34 additions and 63 deletions

View file

@ -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);