also check whether less than zero -- for 'reg' is type 'int', and sizeof
(dwarf2_to_reg_map) is less than 0x7fff.
It is quoted in gdb_assert(), so need check 'reg' whether less than zero.
And the related warning (with '-W'):
../../binutils-gdb/gdb/microblaze-tdep.c:667:3: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
ChangeLog:
* microblaze-tdep.c (microblaze_dwarf2_reg_to_regnum): Check whether
less tha zero in conditional expression.
+2014-07-23 Chen Gang <gang.chen.5i5j@gmail.com>
+
+ * microblaze-tdep.c (microblaze_dwarf2_reg_to_regnum): Check whether
+ less than zero in conditional expression.
+
2014-07-23 Tom Tromey <tromey@redhat.com>
* make-target-delegates ($ARGS_PART): Match trailing close paren.
static int
microblaze_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int reg)
{
- gdb_assert (reg < sizeof (dwarf2_to_reg_map));
+ gdb_assert ((size_t) reg < sizeof (dwarf2_to_reg_map));
return dwarf2_to_reg_map[reg];
}