Kaydet (Commit) 0a857280 authored tarafından Gregory P. Smith's avatar Gregory P. Smith

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

undefined behavior.
üst 937f2f70
...@@ -3448,7 +3448,7 @@ calc_binint(char *s, int x) ...@@ -3448,7 +3448,7 @@ calc_binint(char *s, int x)
* to extend a BININT's sign bit to the full width. * to extend a BININT's sign bit to the full width.
*/ */
if (x == 4 && l & (1L << 31)) if (x == 4 && l & (1L << 31))
l |= (~0L) << 32; l |= (~0UL) << 32;
#endif #endif
return l; return l;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment