diff options
author | Dominik Vogt <vogt@linux.vnet.ibm.com> | 2015-11-17 10:56:32 +0100 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2015-11-17 10:56:32 +0100 |
commit | 66c6502d7a457057683f56fd6d606fd9b2da0655 (patch) | |
tree | 522410682e2dd98ce2a28f630d98759eb41a1f34 /gdb/dwarf2read.c | |
parent | 146b80ff180c0490fa920c183d665f536f2a4b0b (diff) | |
download | gdb-66c6502d7a457057683f56fd6d606fd9b2da0655.zip gdb-66c6502d7a457057683f56fd6d606fd9b2da0655.tar.gz gdb-66c6502d7a457057683f56fd6d606fd9b2da0655.tar.bz2 |
gdb: Fix left shift of negative value.
This patch fixes all occurences of left-shifting negative constants in C cod
which is undefined by the C standard.
gdb/ChangeLog:
* hppa-tdep.c (hppa_sign_extend, hppa_low_hppa_sign_extend)
(prologue_inst_adjust_sp, hppa_frame_cache): Fix left shift of negative
value.
* dwarf2read.c (read_subrange_type): Likewise.
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r-- | gdb/dwarf2read.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 87dc8b4..48921e7 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -15048,7 +15048,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) the bounds as signed, and thus sign-extend their values, when the base type is signed. */ negative_mask = - (LONGEST) -1 << (TYPE_LENGTH (base_type) * TARGET_CHAR_BIT - 1); + -((LONGEST) 1 << (TYPE_LENGTH (base_type) * TARGET_CHAR_BIT - 1)); if (low.kind == PROP_CONST && !TYPE_UNSIGNED (base_type) && (low.data.const_val & negative_mask)) low.data.const_val |= negative_mask; |