This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
PATCH: gas/app.c: Do not UNGET an EOF value
- From: Nick Clifton <nickc at redhat dot com>
- To: binutils at sourceware dot org
- Date: Wed, 04 Jun 2008 17:10:12 +0100
- Subject: PATCH: gas/app.c: Do not UNGET an EOF value
Hi Guys,
I am applying the patch below to fix a couple of cases in
do_scrub_chars() where we could theoretically attempt to push an EOF
marker back into an empty buffer.
Cheers
Nick
gas/ChangeLog
2008-06-04 Nick Clifton <nickc@redhat.com>
* app.c (do_scrub_chars): Do not UNGET an EOF value.
Index: gas/app.c
===================================================================
RCS file: /cvs/src/src/gas/app.c,v
retrieving revision 1.44
diff -c -3 -p -r1.44 app.c
*** gas/app.c 20 Jul 2007 08:20:27 -0000 1.44
--- gas/app.c 4 Jun 2008 16:07:20 -0000
*************** do_scrub_chars (int (*get) (char *, int)
*** 832,838 ****
/* Only keep this white if there's no white *after* the
colon. */
ch2 = GET ();
! UNGET (ch2);
if (!IS_WHITESPACE (ch2))
{
state = 9;
--- 832,839 ----
/* Only keep this white if there's no white *after* the
colon. */
ch2 = GET ();
! if (ch2 != EOF)
! UNGET (ch2);
if (!IS_WHITESPACE (ch2))
{
state = 9;
*************** do_scrub_chars (int (*get) (char *, int)
*** 1116,1122 ****
#ifdef DOUBLEBAR_PARALLEL
case LEX_IS_DOUBLEBAR_1ST:
ch2 = GET ();
! UNGET (ch2);
if (ch2 != '|')
goto de_fault;
--- 1117,1124 ----
#ifdef DOUBLEBAR_PARALLEL
case LEX_IS_DOUBLEBAR_1ST:
ch2 = GET ();
! if (ch2 != EOF)
! UNGET (ch2);
if (ch2 != '|')
goto de_fault;