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

(cherry picked from commit 713eb184b5)

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
This commit is contained in:
Miss Islington (bot) 2022-06-04 23:47:12 -07:00 committed by GitHub
parent d97e2c52d3
commit c21f2bdaf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

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;