public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Silly bug in tc-i386.c
@ 2003-07-02 20:13 Daniel Jacobowitz
  2003-07-04 10:46 ` Nick Clifton
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Jacobowitz @ 2003-07-02 20:13 UTC (permalink / raw)
  To: binutils

In tc_x86_regname_to_dw2regnum:

      regnames_count = sizeof (regnames_32);


  for (regnum = 0; regnum < regnames_count; regnum++)
    if (strcmp (regname, regnames[regnum]) == 0)
      return regnum;

There's a missing '/ sizeof (regnames[0])' there...

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Silly bug in tc-i386.c
  2003-07-02 20:13 Silly bug in tc-i386.c Daniel Jacobowitz
@ 2003-07-04 10:46 ` Nick Clifton
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Clifton @ 2003-07-04 10:46 UTC (permalink / raw)
  To: binutils

Hi Daniel,

> In tc_x86_regname_to_dw2regnum:
>
>       regnames_count = sizeof (regnames_32);
>
>
>   for (regnum = 0; regnum < regnames_count; regnum++)
>     if (strcmp (regname, regnames[regnum]) == 0)
>       return regnum;
>
> There's a missing '/ sizeof (regnames[0])' there...

Indeed there is.  Fixed as follows.

Cheers
        Nick

2003-07-04  Nick Clifton  <nickc@redhat.com>

	* config/tc-i386.c (tc_x86_regname_to_dw2regnum): Use ARRAY_SIZE
	macro to compute size of selected register name array.

Index: gas/config/tc-i386.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-i386.c,v
retrieving revision 1.143
diff -c -3 -p -r1.143 tc-i386.c
*** gas/config/tc-i386.c	26 Jun 2003 17:50:41 -0000	1.143
--- gas/config/tc-i386.c	4 Jul 2003 10:44:55 -0000
*************** tc_x86_regname_to_dw2regnum (const char 
*** 6366,6377 ****
    if (flag_code == CODE_64BIT)
      {
        regnames = regnames_64;
!       regnames_count = sizeof (regnames_64);
      }
    else
      {
        regnames = regnames_32;
!       regnames_count = sizeof (regnames_32);
      }
  
    for (regnum = 0; regnum < regnames_count; regnum++)
--- 6366,6377 ----
    if (flag_code == CODE_64BIT)
      {
        regnames = regnames_64;
!       regnames_count = ARRAY_SIZE (regnames_64);
      }
    else
      {
        regnames = regnames_32;
!       regnames_count = ARRAY_SIZE (regnames_32);
      }
  
    for (regnum = 0; regnum < regnames_count; regnum++)
        

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-07-04 10:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-02 20:13 Silly bug in tc-i386.c Daniel Jacobowitz
2003-07-04 10:46 ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).