diff options
author | Dominik Vogt <vogt@linux.vnet.ibm.com> | 2015-11-09 17:12:56 +0100 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2015-11-09 17:12:56 +0100 |
commit | c4e0beacd71d4a65cfbe27466ae3d0403c39ead5 (patch) | |
tree | 09710f91615986de4df254d6132d3d7d986e3fa2 /binutils/dwarf.c | |
parent | 29f628db8835fd86b85ffb40d4a9ed5b1c28f1e6 (diff) | |
download | gdb-c4e0beacd71d4a65cfbe27466ae3d0403c39ead5.zip gdb-c4e0beacd71d4a65cfbe27466ae3d0403c39ead5.tar.gz gdb-c4e0beacd71d4a65cfbe27466ae3d0403c39ead5.tar.bz2 |
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.
Diffstat (limited to 'binutils/dwarf.c')
-rw-r--r-- | binutils/dwarf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c index c14049a..9f1baea 100644 --- a/binutils/dwarf.c +++ b/binutils/dwarf.c @@ -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; } |