From: Neil Schemenauer Date: Sun, 5 Jun 2022 03:53:16 +0000 (-0700) Subject: gh-93442: Add test for _Py_CAST(nullptr). (gh-93505) X-Git-Tag: v3.12.0a1~1357 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=713eb184b50f2b8b138fb01187ee32fa29a815c9;p=thirdparty%2FPython%2Fcpython.git gh-93442: Add test for _Py_CAST(nullptr). (gh-93505) --- diff --git a/Lib/test/_testcppext.cpp b/Lib/test/_testcppext.cpp index 70f434e6789a..5e3d76b7b207 100644 --- a/Lib/test/_testcppext.cpp +++ b/Lib/test/_testcppext.cpp @@ -77,6 +77,9 @@ test_api_casts(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args)) // gh-93442: Pass 0 as NULL for PyObject* Py_XINCREF(0); Py_XDECREF(0); + // ensure that nullptr works too + Py_XINCREF(nullptr); + Py_XDECREF(nullptr); Py_DECREF(obj); Py_RETURN_NONE;