Don't left shift negative values. Use an unsigned value instead to avoid

undefined behavior.
This commit is contained in:
Gregory P. Smith 2015-08-04 16:29:00 -07:00
parent 937f2f70f5
commit 0a8572800b
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}