From 154b82dc7a655809172117d0f7d669b589b2e594 Mon Sep 17 00:00:00 2001 From: Kevin Buettner Date: Sat, 3 Sep 2005 01:55:26 +0000 Subject: [PATCH] Make sure that a reasonable value is always returned by mn10300_dwarf2_reg_to_regnum(). --- gdb/mn10300-tdep.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index 532015d4049..4e9f372dfdf 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -963,7 +963,10 @@ mn10300_dwarf2_reg_to_regnum (int dwarf2) if (dwarf2 < 0 || dwarf2 >= ARRAY_SIZE (dwarf2_to_gdb) || dwarf2_to_gdb[dwarf2] == -1) - warning (_("bogus register number in debug info: %d"), dwarf2); + { + warning (_("Bogus register number in debug info: %d"), dwarf2); + return 0; + } return dwarf2_to_gdb[dwarf2]; } -- 2.30.2