This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Silly bug in tc-i386.c


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++)
        


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]