gh-93442: Add test for _Py_CAST(nullptr). (gh-93505)

This commit is contained in:
Neil Schemenauer 2022-06-04 20:53:16 -07:00 committed by GitHub
parent 8bcc3fa345
commit 713eb184b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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;