Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythongh-110481: Fix Py_SET_REFCNT() integer overflow
If Py_SET_REFCNT() is called with a reference count larger than UINT32_MAX, clamp the value to UINT32_MAX to have a deterministic behavior. Set _Py_IMMORTAL_REFCNT constant type to Py_ssize_t to fix the following compiler warning: Include/internal/pycore_global_objects_fini_generated.h:14:24: warning: comparison of integers of different signs: 'Py_ssize_t' (aka 'long') and 'unsigned int' [-Wsign-compare] if (Py_REFCNT(obj) < _Py_IMMORTAL_REFCNT) { ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~
- Loading branch information