mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREF
in places where Py_DECREF was used.
This commit is contained in:
parent
e0805cf10e
commit
57a01d3a0e
20 changed files with 52 additions and 42 deletions
|
@ -424,7 +424,7 @@ type_set_name(PyTypeObject *type, PyObject *value, void *context)
|
|||
|
||||
type->tp_name = tp_name;
|
||||
Py_INCREF(value);
|
||||
Py_XSETREF(((PyHeapTypeObject*)type)->ht_name, value);
|
||||
Py_SETREF(((PyHeapTypeObject*)type)->ht_name, value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -445,7 +445,7 @@ type_set_qualname(PyTypeObject *type, PyObject *value, void *context)
|
|||
|
||||
et = (PyHeapTypeObject*)type;
|
||||
Py_INCREF(value);
|
||||
Py_XSETREF(et->ht_qualname, value);
|
||||
Py_SETREF(et->ht_qualname, value);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2897,7 +2897,7 @@ _PyType_Lookup(PyTypeObject *type, PyObject *name)
|
|||
else
|
||||
method_cache_misses++;
|
||||
#endif
|
||||
Py_XSETREF(method_cache[h].name, name);
|
||||
Py_SETREF(method_cache[h].name, name);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue