Skip to content

Commit da461ea

Browse files
authored
gh-121617: Fix Py_CLEAR() memcpy in C++: replace NULL with _Py_NULL (#157188)
1 parent 7f3d7d0 commit da461ea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Include/refcount.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ static inline Py_ALWAYS_INLINE void Py_DECREF(PyObject *op)
494494
do { \
495495
PyObject **_tmp_op_ptr = _Py_CAST(PyObject**, &(op)); \
496496
PyObject *_tmp_old_op = (*_tmp_op_ptr); \
497-
if (_tmp_old_op != NULL) { \
497+
if (_tmp_old_op != _Py_NULL) { \
498498
PyObject *_null_ptr = _Py_NULL; \
499499
memcpy(_tmp_op_ptr, &_null_ptr, sizeof(PyObject*)); \
500500
Py_DECREF(_tmp_old_op); \

0 commit comments

Comments
 (0)