From: Alan Modra Date: Mon, 11 Apr 2011 04:52:34 +0000 (+0000) Subject: * config/tc-cr16.c (getprocreg_image): Correct range check. X-Git-Tag: binutils-2_21_1~110 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ccf7fc2b43d92a12b952f6046a3d1373e2ff3be3;p=thirdparty%2Fbinutils-gdb.git * config/tc-cr16.c (getprocreg_image): Correct range check. (getprocregp_image): Likewise. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index 127efed585e..a602827b6e2 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2011-04-11 Alan Modra + + * config/tc-cr16.c (getprocreg_image): Correct range check. + (getprocregp_image): Likewise. + 2011-03-26 John Marino * configure.tgt: Fix support for *-*-dragonfly*. diff --git a/gas/config/tc-cr16.c b/gas/config/tc-cr16.c index a6185f99af8..09e51b3f856 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 @@ -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)