mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #22570: Renamed Py_SETREF to Py_XSETREF.
This commit is contained in:
parent
0e0563ca2c
commit
48842714b9
37 changed files with 132 additions and 132 deletions
|
@ -856,14 +856,14 @@ PyAPI_FUNC(void) _Py_Dealloc(PyObject *);
|
|||
*
|
||||
* The safe way is:
|
||||
*
|
||||
* Py_SETREF(op, op2);
|
||||
* Py_XSETREF(op, op2);
|
||||
*
|
||||
* That arranges to set `op` to `op2` _before_ decref'ing, so that any code
|
||||
* triggered as a side-effect of `op` getting torn down no longer believes
|
||||
* `op` points to a valid object.
|
||||
*/
|
||||
|
||||
#define Py_SETREF(op, op2) \
|
||||
#define Py_XSETREF(op, op2) \
|
||||
do { \
|
||||
PyObject *_py_tmp = (PyObject *)(op); \
|
||||
(op) = (op2); \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue