aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2expr.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-05-13 18:54:59 +0000
committerTom Tromey <tromey@redhat.com>2011-05-13 18:54:59 +0000
commit9930639c02b3ad2d2f77549b3267df6a422bf060 (patch)
tree8ac8733a28cf7346b5964743d8521717c0f2c524 /gdb/dwarf2expr.c
parent7e0396aae0e22d466305c1e2a775ccc4888aab06 (diff)
gdb
* dwarf2expr.c (read_uleb128): Cast intermediate result. (read_sleb128): Likewise. gdb/testsuite * gdb.dwarf2/clztest.exp: New file. * gdb.dwarf2/clztest.c: New file. * gdb.dwarf2/clztest.S: New file.
Diffstat (limited to 'gdb/dwarf2expr.c')
-rw-r--r--gdb/dwarf2expr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c
index b42f28914b..1fe8b796b5 100644
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -364,7 +364,7 @@ read_uleb128 (const gdb_byte *buf, const gdb_byte *buf_end, ULONGEST * r)
error (_("read_uleb128: Corrupted DWARF expression."));
byte = *buf++;
- result |= (byte & 0x7f) << shift;
+ result |= ((ULONGEST) (byte & 0x7f)) << shift;
if ((byte & 0x80) == 0)
break;
shift += 7;
@@ -390,7 +390,7 @@ read_sleb128 (const gdb_byte *buf, const gdb_byte *buf_end, LONGEST * r)
error (_("read_sleb128: Corrupted DWARF expression."));
byte = *buf++;
- result |= (byte & 0x7f) << shift;
+ result |= ((ULONGEST) (byte & 0x7f)) << shift;
shift += 7;
if ((byte & 0x80) == 0)
break;