From: Chris Eibl <138194463+chris-eibl@users.noreply.github.com> Date: Fri, 18 Apr 2025 08:45:30 +0000 (+0200) Subject: GH-131296: fix clang-cl warning on Windows in `Objects/longobject.c` for 32bit builds... X-Git-Tag: v3.14.0b1~424 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=80295a8f9b624c8d962b1df6bc9b89049e11bcf5;p=thirdparty%2FPython%2Fcpython.git GH-131296: fix clang-cl warning on Windows in `Objects/longobject.c` for 32bit builds (#131604) --- diff --git a/Objects/longobject.c b/Objects/longobject.c index 692312c1ad97..ffb3f95bdb95 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -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;