PATCH: Fix thinko parsing IQ2000 ignored arguments array

Nick Clifton nickc@redhat.com
Wed Jan 12 10:56:00 GMT 2005


Hi Guys,

  I am applying the patch below to fix a stupid little bug that I
  introduced when I tidied up the IQ2000 specific GAS code.  The
  ignored_arguments array was being walked one character at a time
  rather than one pointer at a time, which eventually resulted in a
  seg fault due to an illegal memory access.

Cheers
  Nick

gas/ChangeLog
2005-01-12  Nick Clifton  <nickc@redhat.com>

	* config/tc-iq2000.c (s_iq2000_set): Fix thinko parsing
	ignored_arguments array.

Index: gas/config/tc-iq2000.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-iq2000.c,v
retrieving revision 1.5
diff -c -3 -p -r1.5 tc-iq2000.c
*** gas/config/tc-iq2000.c	24 Nov 2004 13:23:41 -0000	1.5
--- gas/config/tc-iq2000.c	12 Jan 2005 10:54:21 -0000
*************** s_iq2000_set (int x ATTRIBUTE_UNUSED)
*** 686,692 ****
        "nobopt",
        NULL
      };
!   const char * ignored;
    char *name = input_line_pointer, ch;
    char *save_ILP = input_line_pointer;
  
--- 686,692 ----
        "nobopt",
        NULL
      };
!   const char ** ignored;
    char *name = input_line_pointer, ch;
    char *save_ILP = input_line_pointer;
  
*************** s_iq2000_set (int x ATTRIBUTE_UNUSED)
*** 695,704 ****
    ch = *input_line_pointer;
    *input_line_pointer = '\0';
  
!   for (ignored = ignored_arguments[0]; ignored; ignored ++)
!     if (strcmp (ignored, name) == 0)
        break;
!   if (ignored == NULL)
      {
        /* We'd like to be able to use .set symbol, expn */
        input_line_pointer = save_ILP;
--- 695,704 ----
    ch = *input_line_pointer;
    *input_line_pointer = '\0';
  
!   for (ignored = ignored_arguments; * ignored; ignored ++)
!     if (strcmp (* ignored, name) == 0)
        break;
!   if (* ignored == NULL)
      {
        /* We'd like to be able to use .set symbol, expn */
        input_line_pointer = save_ILP;
  



More information about the Binutils mailing list