mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-30 12:44:10 +08:00
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:
parent
29f628db88
commit
c4e0beacd7
@ -1,3 +1,7 @@
|
||||
2015-11-09 Dominik Vogt <vogt@linux.vnet.ibm.com>
|
||||
|
||||
* dwarf.c (read_leb128): Fix left shift of negative value.
|
||||
|
||||
2015-11-03 Alan Modra <amodra@gmail.com>
|
||||
|
||||
* readelf (process_version_sections): Check DT_VERNEED and
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user