diff options
Diffstat (limited to 'gdb/microblaze-tdep.c')
-rw-r--r-- | gdb/microblaze-tdep.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c index 02dfd2d..4bcd88d 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -638,8 +638,9 @@ static int dwarf2_to_reg_map[78] = static int microblaze_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int reg) { - gdb_assert ((size_t) reg < sizeof (dwarf2_to_reg_map)); - return dwarf2_to_reg_map[reg]; + if (reg >= 0 && reg < sizeof (dwarf2_to_reg_map)) + return dwarf2_to_reg_map[reg]; + return -1; } static void |