cpython/Objects
Victor Stinner 135ec7cefb
gh-99537: Use Py_SETREF() function in C code (#99657)
Fix potential race condition in code patterns:

* Replace "Py_DECREF(var); var = new;" with "Py_SETREF(var, new);"
* Replace "Py_XDECREF(var); var = new;" with "Py_XSETREF(var, new);"
* Replace "Py_CLEAR(var); var = new;" with "Py_XSETREF(var, new);"

Other changes:

* Replace "old = var; var = new; Py_DECREF(var)"
  with "Py_SETREF(var, new);"
* Replace "old = var; var = new; Py_XDECREF(var)"
  with "Py_XSETREF(var, new);"
* And remove the "old" variable.
2022-11-22 13:39:11 +01:00
..
clinic
stringlib gh-99537: Use Py_SETREF() function in C code (#99657) 2022-11-22 13:39:11 +01:00
abstract.c gh-99300: Use Py_NewRef() in Objects/ directory (#99332) 2022-11-10 16:27:32 +01:00
boolobject.c gh-99300: Use Py_NewRef() in Objects/ directory (#99332) 2022-11-10 16:27:32 +01:00
bytearrayobject.c gh-99300: Replace Py_INCREF() with Py_NewRef() (#99513) 2022-11-16 10:39:47 +01:00
bytes_methods.c
bytesobject.c gh-99537: Use Py_SETREF() function in C code (#99657) 2022-11-22 13:39:11 +01:00
call.c gh-81057: Move the global Dict-Related Versions to _PyRuntimeState (gh-99497) 2022-11-16 10:37:29 -07:00
capsule.c gh-99537: Use Py_SETREF() function in C code (#99657) 2022-11-22 13:39:11 +01:00
cellobject.c gh-99300: Use Py_NewRef() in Objects/ directory (#99332) 2022-11-10 16:27:32 +01:00
classobject.c gh-99300: Use Py_NewRef() in Objects/ directory (#99332) 2022-11-10 16:27:32 +01:00
codeobject.c gh-99300: Use Py_NewRef() in Objects/ directory (#99332) 2022-11-10 16:27:32 +01:00
complexobject.c gh-99300: Use Py_NewRef() in Objects/ directory (#99332) 2022-11-10 16:27:32 +01:00
descrobject.c gh-99443: descr_set_trampoline_call return type should be int not PyObject* (#99444) 2022-11-16 15:20:17 -08:00
dictnotes.txt
dictobject.c gh-81057: Move the global Dict-Related Versions to _PyRuntimeState (gh-99497) 2022-11-16 10:37:29 -07:00
enumobject.c gh-99300: Use Py_NewRef() in Objects/ directory (#99335) 2022-11-10 22:22:02 +01:00
exception_handling_notes.txt
exceptions.c gh-99553: fix bug where an ExceptionGroup subclass can wrap a BaseException (GH-99572) 2022-11-18 15:44:43 +00:00
fileobject.c gh-99537: Use Py_SETREF() function in C code (#99657) 2022-11-22 13:39:11 +01:00
floatobject.c gh-99537: Use Py_SETREF() function in C code (#99657) 2022-11-22 13:39:11 +01:00
frame_layout.md GH-96421: Insert shim frame on entry to interpreter (GH-96319) 2022-11-10 12:34:57 +00:00
frameobject.c Remove old comment (GH-99489) 2022-11-16 13:43:31 -08:00
funcobject.c gh-91053: Add an optional callback that is invoked whenever a function is modified (#98175) 2022-11-22 13:06:44 +01:00
genericaliasobject.c gh-99300: Use Py_NewRef() in Objects/ directory (#99335) 2022-11-10 22:22:02 +01:00
genobject.c gh-99537: Use Py_SETREF() function in C code (#99657) 2022-11-22 13:39:11 +01:00
interpreteridobject.c
iterobject.c gh-99300: Use Py_NewRef() in Objects/ directory (#99335) 2022-11-10 22:22:02 +01:00
listobject.c gh-99300: Use Py_NewRef() in Objects/listobject.c (#99336) 2022-11-10 22:09:18 +01:00
listsort.txt
lnotab_notes.txt
locations.md
longobject.c gh-99537: Use Py_SETREF() function in longobject C code (#99655) 2022-11-22 13:04:19 +01:00
memoryobject.c gh-99300: Use Py_NewRef() in Objects/ directory (#99354) 2022-11-10 23:58:07 +01:00
methodobject.c gh-99300: Use Py_NewRef() in Objects/ directory (#99354) 2022-11-10 23:58:07 +01:00
moduleobject.c gh-81057: Move More Globals in Core Code to _PyRuntimeState (gh-99516) 2022-11-16 09:37:14 -07:00
namespaceobject.c gh-99300: Replace Py_INCREF() with Py_NewRef() (#99530) 2022-11-16 18:34:24 +01:00
object.c gh-81057: Move Globals in Core Code to _PyRuntimeState (gh-99496) 2022-11-15 09:45:11 -07:00
object_layout.md
object_layout_312.gv
object_layout_312.png
object_layout_full_312.gv
object_layout_full_312.png
obmalloc.c gh-81057: Move Globals in Core Code to _PyRuntimeState (gh-99496) 2022-11-15 09:45:11 -07:00
odictobject.c gh-99300: Replace Py_INCREF() with Py_NewRef() (#99530) 2022-11-16 18:34:24 +01:00
picklebufobject.c
rangeobject.c gh-99300: Replace Py_INCREF() with Py_NewRef() (#99530) 2022-11-16 18:34:24 +01:00
README
setobject.c gh-99537: Use Py_SETREF() function in C code (#99657) 2022-11-22 13:39:11 +01:00
sliceobject.c gh-99537: Use Py_SETREF() function in C code (#99657) 2022-11-22 13:39:11 +01:00
structseq.c gh-99300: Use Py_NewRef() in Objects/ directory (#99354) 2022-11-10 23:58:07 +01:00
tupleobject.c gh-99300: Use Py_NewRef() in Objects/ directory (#99351) 2022-11-10 23:40:31 +01:00
typeobject.c gh-99537: Use Py_SETREF() function in C code (#99657) 2022-11-22 13:39:11 +01:00
typeslots.inc
typeslots.py
unicodectype.c
unicodeobject.c gh-99537: Use Py_SETREF() function in C code (#99657) 2022-11-22 13:39:11 +01:00
unicodetype_db.h
unionobject.c gh-99300: Replace Py_INCREF() with Py_NewRef() (#99530) 2022-11-16 18:34:24 +01:00
weakrefobject.c gh-99537: Use Py_SETREF() function in C code (#99657) 2022-11-22 13:39:11 +01:00

Source files for various builtin objects