]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-91321: Fix _PyObject_EXTRA_INIT for C++ (#92396)
authorVictor Stinner <vstinner@python.org>
Fri, 6 May 2022 12:40:08 +0000 (14:40 +0200)
committerGitHub <noreply@github.com>
Fri, 6 May 2022 12:40:08 +0000 (13:40 +0100)
In C++, the _PyObject_EXTRA_INIT macro now uses nullptr, rather than
0, to initialize the _ob_next and _ob_prev members of the PyObject
structure.

Fix test_cppext failure when Python is built with
./configure --with-trace-refs.

Include/object.h

index a0dba697569c43daba4053ca83f5d13e6f1d591b..fac8892f65552787c71471583f8b0bb2779af613 100644 (file)
@@ -66,7 +66,7 @@ whose size is determined when the object is allocated.
     PyObject *_ob_next;           \
     PyObject *_ob_prev;
 
-#define _PyObject_EXTRA_INIT 0, 0,
+#define _PyObject_EXTRA_INIT _Py_NULL, _Py_NULL,
 
 #else
 #  define _PyObject_HEAD_EXTRA