diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-09 11:46:20 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-02-09 11:46:20 (GMT) |
commit | dfe98a102ec8723d750f78ecda08a7adb9360eb1 (patch) | |
tree | f8aea8fb3d74be18ed67a2f4e0a355ad9beb42d8 /Python/ceval.c | |
parent | 2623c8c23cead505a78ec416072223552e94727e (diff) | |
parent | 505ff755d704c73ac613d3e8fed02c79c6ae555a (diff) | |
download | cpython-dfe98a102ec8723d750f78ecda08a7adb9360eb1.zip cpython-dfe98a102ec8723d750f78ecda08a7adb9360eb1.tar.gz cpython-dfe98a102ec8723d750f78ecda08a7adb9360eb1.tar.bz2 |
Issue #20437: Fixed 22 potential bugs when deleting objects references.
Diffstat (limited to 'Python/ceval.c')
-rw-r--r-- | Python/ceval.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 34c52b0..5db88be 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -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); |