From: Gregory P. Smith Date: Tue, 4 Aug 2015 23:29:00 +0000 (-0700) Subject: Don't left shift negative values. Use an unsigned value instead to avoid X-Git-Tag: v2.7.11rc1~202 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0a8572800b08ee2598d3db2b7b24bd3884ba11cd;p=thirdparty%2FPython%2Fcpython.git Don't left shift negative values. Use an unsigned value instead to avoid undefined behavior. --- diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 91f3ee7bd5a0..89448a6f4190 100644 --- a/Modules/cPickle.c +++ b/Modules/cPickle.c @@ -3448,7 +3448,7 @@ calc_binint(char *s, int x) * to extend a BININT's sign bit to the full width. */ if (x == 4 && l & (1L << 31)) - l |= (~0L) << 32; + l |= (~0UL) << 32; #endif return l; }