forked from Imagelibrary/binutils-gdb
binutils: Fix left shift of negative value.
This patch fixes all occurences of left-shifting negative constants in C code
which is undefined by the C standard.
binutils/ChangeLog:
* dwarf.c (read_leb128): Fix left shift of negative value.
This commit is contained in:
committed by
Andreas Krebbel
parent
29f628db88
commit
c4e0beacd7
@@ -292,7 +292,7 @@ read_leb128 (unsigned char *data,
|
||||
*length_return = num_read;
|
||||
|
||||
if (sign && (shift < 8 * sizeof (result)) && (byte & 0x40))
|
||||
result |= (dwarf_vma) -1 << shift;
|
||||
result |= -((dwarf_vma) 1 << shift);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user