We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Objects/longobject.c
1 parent fc0ec29 commit 80295a8Copy full SHA for 80295a8
Objects/longobject.c
@@ -909,7 +909,9 @@ _PyLong_NumBits(PyObject *vv)
909
assert(ndigits == 0 || v->long_value.ob_digit[ndigits - 1] != 0);
910
if (ndigits > 0) {
911
digit msd = v->long_value.ob_digit[ndigits - 1];
912
+#if SIZEOF_SIZE_T == 8
913
assert(ndigits <= INT64_MAX / PyLong_SHIFT);
914
+#endif
915
result = (int64_t)(ndigits - 1) * PyLong_SHIFT;
916
msd_bits = bit_length_digit(msd);
917
result += msd_bits;
0 commit comments