[PATCH] S/390: Fix invalid left shift of negative integer value.

Dominik Vogt vogt@linux.vnet.ibm.com
Fri Oct 30 14:27:00 GMT 2015


On Fri, Oct 30, 2015 at 01:45:11PM +0100, Andreas Schwab wrote:
> Dominik Vogt <vogt@linux.vnet.ibm.com> writes:
> > -  return ((addr + (1 << align) - 1) & (-1 << align));
> > +  return ((addr + (1 << align) - 1) & (~0u << align));
> 
> This is not the same if valueT is wider than int.

You're right.  I'll fix that and send a new patch in a different
thread with fixes for all such shifts in binutils_gdb.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
IBM Germany



More information about the Binutils mailing list