]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-93442: Add test for _Py_CAST(nullptr). (gh-93505) (gh-93509)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 5 Jun 2022 06:47:12 +0000 (23:47 -0700)
committerGitHub <noreply@github.com>
Sun, 5 Jun 2022 06:47:12 +0000 (15:47 +0900)
(cherry picked from commit 713eb184b50f2b8b138fb01187ee32fa29a815c9)

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
Lib/test/_testcppext.cpp

index 70f434e6789ad7283b57ce8233322753bf4bf76f..5e3d76b7b20723b5f210a240d744d60fded730aa 100644 (file)
@@ -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;