aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2-frame.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2013-04-19 15:35:21 +0000
committerPedro Alves <palves@redhat.com>2013-04-19 15:35:21 +0000
commit507a579c9a5e778ae737c7066df4864c5f1d2ccc (patch)
tree2c3ee6bfd33bc1d9328004e54a067424999cea16 /gdb/dwarf2-frame.c
parentf9d83a0bd683b2298279bb93be8cf499fef90b6c (diff)
downloadgdb-507a579c9a5e778ae737c7066df4864c5f1d2ccc.zip
gdb-507a579c9a5e778ae737c7066df4864c5f1d2ccc.tar.gz
gdb-507a579c9a5e778ae737c7066df4864c5f1d2ccc.tar.bz2
-Wpointer-sign: dwarf2-frame.c: Pass unsigned variable to safe_read_uleb128.
The 'bytes_read' change should be obvious. As for the other hunk, we're passing the address of the signed 'offset' to safe_read_uleb128, which expects unsigned. Fix it by passing the address of the unsigned 'utmp' instead, like already done on other spots in the file. gdb/ 2013-04-19 Pedro Alves <palves@redhat.com> * dwarf2-frame.c (execute_cfa_program): Make 'bytes_read' local unsigned. Pass 'tmp' to safe_read_uleb128 instead of the signed 'offset', and adjust.
Diffstat (limited to 'gdb/dwarf2-frame.c')
-rw-r--r--gdb/dwarf2-frame.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index dc97590..5c88b03 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -410,7 +410,7 @@ execute_cfa_program (struct dwarf2_fde *fde, const gdb_byte *insn_ptr,
CORE_ADDR pc, struct dwarf2_frame_state *fs)
{
int eh_frame_p = fde->eh_frame_p;
- int bytes_read;
+ unsigned int bytes_read;
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
while (insn_ptr < insn_end && fs->pc <= pc)
@@ -672,8 +672,8 @@ bad CFI data; mismatched DW_CFA_restore_state at %s"),
case DW_CFA_GNU_negative_offset_extended:
insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &reg);
reg = dwarf2_frame_adjust_regnum (gdbarch, reg, eh_frame_p);
- insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &offset);
- offset *= fs->data_align;
+ insn_ptr = safe_read_uleb128 (insn_ptr, insn_end, &utmp);
+ offset = utmp * fs->data_align;
dwarf2_frame_state_alloc_regs (&fs->regs, reg + 1);
fs->regs.reg[reg].how = DWARF2_FRAME_REG_SAVED_OFFSET;
fs->regs.reg[reg].loc.offset = -offset;