From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 5 Jun 2022 06:47:12 +0000 (-0700) Subject: gh-93442: Add test for _Py_CAST(nullptr). (gh-93505) (gh-93509) X-Git-Tag: v3.11.0b4~229 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c21f2bdaf14aae4dc272e66565ada87568641b1e;p=thirdparty%2FPython%2Fcpython.git gh-93442: Add test for _Py_CAST(nullptr). (gh-93505) (gh-93509) (cherry picked from commit 713eb184b50f2b8b138fb01187ee32fa29a815c9) Co-authored-by: Neil Schemenauer Co-authored-by: Neil Schemenauer --- 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;