Don't left shift negative values. Use an unsigned value instead to avoid
undefined behavior.
This commit is contained in:
parent
937f2f70f5
commit
0a8572800b
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue