From 713eb184b50f2b8b138fb01187ee32fa29a815c9 Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Sat, 4 Jun 2022 20:53:16 -0700 Subject: gh-93442: Add test for _Py_CAST(nullptr). (gh-93505) --- Lib/test/_testcppext.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Lib/test/_testcppext.cpp b/Lib/test/_testcppext.cpp index 70f434e..5e3d76b 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; -- cgit v0.12