summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-06-05 06:47:12 (GMT)
committerGitHub <noreply@github.com>2022-06-05 06:47:12 (GMT)
commitc21f2bdaf14aae4dc272e66565ada87568641b1e (patch)
tree894e717927ebe7825e0f4869424b6e03d06315e6
parentd97e2c52d3c7d0f3800cbed3371005295be78921 (diff)
downloadcpython-c21f2bdaf14aae4dc272e66565ada87568641b1e.zip
cpython-c21f2bdaf14aae4dc272e66565ada87568641b1e.tar.gz
cpython-c21f2bdaf14aae4dc272e66565ada87568641b1e.tar.bz2
gh-93442: Add test for _Py_CAST(nullptr). (gh-93505) (gh-93509)
(cherry picked from commit 713eb184b50f2b8b138fb01187ee32fa29a815c9) Co-authored-by: Neil Schemenauer <nas-github@arctrix.com> Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
-rw-r--r--Lib/test/_testcppext.cpp3
1 files changed, 3 insertions, 0 deletions
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;