Skip to content

Commit 878207a

Browse files
committed
update _PyLong_IsNonNegativeCompact
1 parent 8a3d00f commit 878207a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Include/internal/pycore_long.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ PyAPI_FUNC(int) _PyLong_Size_t_Converter(PyObject *, void *);
195195
static inline int
196196
_PyLong_IsNonNegativeCompact(const PyLongObject* op) {
197197
assert(PyLong_Check(op));
198-
return op->long_value.lv_tag <= (1 << NON_SIZE_BITS);
198+
return ((op->long_value.lv_tag & ~IMMORTALITY_BIT_MASK) <= (1 << NON_SIZE_BITS));
199199
}
200200

201201

0 commit comments

Comments
 (0)