mirror of
https://github.com/python/cpython.git
synced 2025-08-25 19:24:42 +00:00
Issue #20440: Massive replacing unsafe attribute setting code with special
macro Py_SETREF.
This commit is contained in:
commit
f006940351
28 changed files with 92 additions and 120 deletions
|
@ -3221,8 +3221,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
|
||||
|
@ -4734,8 +4733,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue