This is the mail archive of the binutils@sourceware.org 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: PATCH: Fix more cases in gas/app.c where UNGET could try to put back an EOF


Oops - forgot the patch.  Here it is:

Index: gas/app.c
===================================================================
RCS file: /cvs/src/src/gas/app.c,v
retrieving revision 1.45
diff -c -3 -p -r1.45 app.c
*** gas/app.c	4 Jun 2008 16:10:21 -0000	1.45
--- gas/app.c	17 Jun 2008 15:43:52 -0000
*************** do_scrub_chars (int (*get) (char *, int)
*** 676,682 ****
  	  if (ch == '\'')
  	    /* Change to avoid warning about unclosed string.  */
  	    PUT ('`');
! 	  else
  	    UNGET (ch);
  	  break;
  #endif
--- 676,682 ----
  	  if (ch == '\'')
  	    /* Change to avoid warning about unclosed string.  */
  	    PUT ('`');
! 	  else if (ch != EOF)
  	    UNGET (ch);
  	  break;
  #endif
*************** do_scrub_chars (int (*get) (char *, int)
*** 1097,1103 ****
  	  ch2 = GET ();
  	  if (ch2 != '-')
  	    {
! 	      UNGET (ch2);
  	      goto de_fault;
  	    }
  	  /* Read and skip to end of line.  */
--- 1097,1104 ----
  	  ch2 = GET ();
  	  if (ch2 != '-')
  	    {
! 	      if (ch2 != EOF)
! 		UNGET (ch2);
  	      goto de_fault;
  	    }
  	  /* Read and skip to end of line.  */
*************** do_scrub_chars (int (*get) (char *, int)
*** 1283,1289 ****
  		  state = 9;
  		  if (!IS_SYMBOL_COMPONENT (ch)) 
  		    {
! 		      UNGET (ch);
  		      break;
  		    }
  		}
--- 1284,1291 ----
  		  state = 9;
  		  if (!IS_SYMBOL_COMPONENT (ch)) 
  		    {
! 		      if (ch != EOF)
! 			UNGET (ch);
  		      break;
  		    }
  		}
*************** do_scrub_chars (int (*get) (char *, int)
*** 1407,1410 ****
  
    return to - tostart;
  }
- 
--- 1409,1411 ----


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