From 0a8572800b08ee2598d3db2b7b24bd3884ba11cd Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Tue, 4 Aug 2015 16:29:00 -0700 Subject: [PATCH] Don't left shift negative values. Use an unsigned value instead to avoid undefined behavior. --- Modules/cPickle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/cPickle.c b/Modules/cPickle.c index 91f3ee7bd5a..89448a6f419 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; }