From 585a1eed45faea53f836b1db2ac211d7f14b44c8 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Thu, 24 Dec 2015 10:35:59 +0200 Subject: Issue #20440: Massive replacing unsafe attribute setting code with special macro Py_SETREF. --- Python/ceval.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'Python/ceval.c') diff --git a/Python/ceval.c b/Python/ceval.c index beabfebc1c..5fa555ed43 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -3214,8 +3214,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) Py_INCREF(self); func = PyMethod_GET_FUNCTION(func); Py_INCREF(func); - Py_DECREF(*pfunc); - *pfunc = self; + Py_SETREF(*pfunc, self); na++; /* n++; */ } else @@ -4670,8 +4669,7 @@ call_function(PyObject ***pp_stack, int oparg Py_INCREF(self); func = PyMethod_GET_FUNCTION(func); Py_INCREF(func); - Py_DECREF(*pfunc); - *pfunc = self; + Py_SETREF(*pfunc, self); na++; n++; } else -- cgit v1.2.1