GH-131296: fix clang-cl warning on Windows in Objects/longobject.c for 32bit builds (#131604)

This commit is contained in:
Chris Eibl 2025-04-18 10:45:30 +02:00 committed by GitHub
parent fc0ec29889
commit 80295a8f9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -909,7 +909,9 @@ _PyLong_NumBits(PyObject *vv)
assert(ndigits == 0 || v->long_value.ob_digit[ndigits - 1] != 0);
if (ndigits > 0) {
digit msd = v->long_value.ob_digit[ndigits - 1];
#if SIZEOF_SIZE_T == 8
assert(ndigits <= INT64_MAX / PyLong_SHIFT);
#endif
result = (int64_t)(ndigits - 1) * PyLong_SHIFT;
msd_bits = bit_length_digit(msd);
result += msd_bits;