Issue #20440: Cleaning up the code by using Py_SETREF.

This commit is contained in:
Serhiy Storchaka 2016-01-05 21:27:54 +02:00
parent dcf76c9d0a
commit 576f132b98
14 changed files with 39 additions and 120 deletions

View file

@ -349,15 +349,11 @@ frame_gettrace(PyFrameObject *f, void *closure)
static int
frame_settrace(PyFrameObject *f, PyObject* v, void *closure)
{
PyObject* old_value;
/* We rely on f_lineno being accurate when f_trace is set. */
f->f_lineno = PyFrame_GetLineNumber(f);
old_value = f->f_trace;
Py_XINCREF(v);
f->f_trace = v;
Py_XDECREF(old_value);
Py_SETREF(f->f_trace, v);
return 0;
}