You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix undefined behavior caused by left-shifting signed 1LL by 63
According to the C11 standard (ISO/IEC 9899:2011, 6.5.7), left-shifting
a signed value into the sign bit results in undefined behavior if the
result is not representable in the type. Specifically, the expression
1LL << 63 invokes undefined behavior because 1LL is a signed long long,
and 2^63 exceeds its positive range.
Replace 1LL << 63 with 1ULL << 63 to ensure the shift is performed on
an unsigned value, which is well-defined.
0 commit comments