summaryrefslogtreecommitdiffstats
path: root/Python/ceval.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-02-09 11:33:53 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-02-09 11:33:53 (GMT)
commit505ff755d704c73ac613d3e8fed02c79c6ae555a (patch)
treeb9b0142cbeca125a1bcf0413e48d938d0cd390d3 /Python/ceval.c
parente9c31470e1680b7c9b9ee83c378b891e90ac58ab (diff)
downloadcpython-505ff755d704c73ac613d3e8fed02c79c6ae555a.zip
cpython-505ff755d704c73ac613d3e8fed02c79c6ae555a.tar.gz
cpython-505ff755d704c73ac613d3e8fed02c79c6ae555a.tar.bz2
Issue #20437: Fixed 21 potential bugs when deleting objects references.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r--Python/ceval.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 73925dc..2b16191 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -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);