aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2011-04-11 04:52:01 +0000
committerAlan Modra <amodra@gmail.com>2011-04-11 04:52:01 +0000
commitd86fff4454536e772ede18a5aaa05ea91e9d31c7 (patch)
tree2dd82154c461f8939f2df1f30d2e93b6d1bd4c45 /gas
parente57278ef9d811d78f6db04a11ea4810ca6ae2575 (diff)
downloadgdb-d86fff4454536e772ede18a5aaa05ea91e9d31c7.zip
gdb-d86fff4454536e772ede18a5aaa05ea91e9d31c7.tar.gz
gdb-d86fff4454536e772ede18a5aaa05ea91e9d31c7.tar.bz2
* config/tc-cr16.c (getprocreg_image): Correct range check.
(getprocregp_image): Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-cr16.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 90f8d7f..13a1075 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-11 Alan Modra <amodra@gmail.com>
+
+ * config/tc-cr16.c (getprocreg_image): Correct range check.
+ (getprocregp_image): Likewise.
+
2011-04-06 Joseph Myers <joseph@codesourcery.com>
* configure.tgt (strongarm*be, strongarm*b, strongarm*,
diff --git a/gas/config/tc-cr16.c b/gas/config/tc-cr16.c
index a6185f9..09e51b3 100644
--- a/gas/config/tc-cr16.c
+++ b/gas/config/tc-cr16.c
@@ -1,5 +1,6 @@
/* tc-cr16.c -- Assembler code for the CR16 CPU core.
- Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright 2007, 2008, 2009, 2010, 2011
+ Free Software Foundation, Inc.
Contributed by M R Swami Reddy <MR.Swami.Reddy@nsc.com>
@@ -1669,7 +1670,7 @@ getprocreg_image (reg r)
char *reg_name;
/* Check whether the register is in registers table. */
- if (r < MAX_REG)
+ if (r >= MAX_REG && r < MAX_PREG)
rreg = &cr16_pregtab[r - MAX_REG];
/* Register not found. */
else
@@ -1708,7 +1709,7 @@ getprocregp_image (reg r)
int pregptab_disp = 0;
/* Check whether the register is in registers table. */
- if (r < MAX_REG)
+ if (r >= MAX_REG && r < MAX_PREG)
{
r = r - MAX_REG;
switch (r)