]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-131782: Fix cast to match type of `bits` in `_Py_TryIncrefCompareStackRef` (#131783)
authorNeil Schemenauer <nas-github@arctrix.com>
Thu, 27 Mar 2025 08:28:59 +0000 (01:28 -0700)
committerGitHub <noreply@github.com>
Thu, 27 Mar 2025 08:28:59 +0000 (13:58 +0530)
Include/internal/pycore_stackref.h

index 1a68e0e29da8f10566df58ad3e9fe14da4351c4c..80e8f4f365f1da5cfd2512567671716857bf10c2 100644 (file)
@@ -668,7 +668,7 @@ static inline int
 _Py_TryIncrefCompareStackRef(PyObject **src, PyObject *op, _PyStackRef *out)
 {
     if (_PyObject_HasDeferredRefcount(op)) {
-        *out = (_PyStackRef){ .bits = (intptr_t)op | Py_TAG_DEFERRED };
+        *out = (_PyStackRef){ .bits = (uintptr_t)op | Py_TAG_DEFERRED };
         return 1;
     }
     if (_Py_TryIncrefCompare(src, op)) {