public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Bernd Schmidt <bernds_cb1@t-online.de>
To: Nick Clifton <nickc@redhat.com>
Cc: binutils@sources.redhat.com
Subject: Re: gas patch: Check TC_EOL_IN_INSN in input-scrub.c
Date: Mon, 16 Oct 2006 20:53:00 -0000	[thread overview]
Message-ID: <4533751B.1020001@t-online.de> (raw)
In-Reply-To: <452F7159.4090507@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 433 bytes --]

Nick Clifton wrote:
> Hi Bernd,
> 
>>     * input-scrub.c (input_scrub_next_buffer): Use TC_EOL_IN_INSN
>>     in addition to testing for '\n'.
> 
> Approved - please apply.
> 
> (I looked at the code and did not see any obvious way to fix this 
> problem other than your solution).

Thanks.  I've had to add a default definition of TC_EOL_IN_INSN as it 
otherwise failed to compile on i686-linux.  Here's what I committed.


Bernd


[-- Attachment #2: scrub2.diff --]
[-- Type: text/plain, Size: 2228 bytes --]

Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gas/ChangeLog,v
retrieving revision 1.3023
diff -c -p -r1.3023 ChangeLog
*** ChangeLog	13 Oct 2006 11:36:02 -0000	1.3023
--- ChangeLog	16 Oct 2006 11:58:37 -0000
***************
*** 1,3 ****
--- 1,9 ----
+ 2006-10-16  Bernd Schmidt  <bernd.schmidt@analog.com>
+ 
+ 	* input-scrub.c (input_scrub_next_buffer): Use TC_EOL_IN_INSN
+ 	in addition to testing for '\n'.
+ 	(TC_EOL_IN_INSN): Provide a default definition if necessary.
+ 
  2006-10-13  Sterling Augstine  <sterling@tensilica.com>
  
  	* dwarf2dbg.c (out_debug_info): Use TC_DWARF2_EMIT_OFFSET to emit
Index: input-scrub.c
===================================================================
RCS file: /cvs/src/src/gas/input-scrub.c,v
retrieving revision 1.16
diff -c -p -r1.16 input-scrub.c
*** input-scrub.c	7 Jun 2006 11:27:57 -0000	1.16
--- input-scrub.c	16 Oct 2006 11:58:37 -0000
***************
*** 56,61 ****
--- 56,65 ----
  #define BEFORE_SIZE (1)
  #define AFTER_SIZE  (1)
  
+ #ifndef TC_EOL_IN_INSN
+ #define TC_EOL_IN_INSN(P) 0
+ #endif
+ 
  static char *buffer_start;	/*->1st char of full buffer area.  */
  static char *partial_where;	/*->after last full line in buffer.  */
  static int partial_size;	/* >=0. Number of chars in partial line in buffer.  */
*************** input_scrub_next_buffer (char **bufp)
*** 341,348 ****
    if (limit)
      {
        register char *p;		/* Find last newline.  */
! 
!       for (p = limit - 1; *p != '\n'; --p)
  	;
        ++p;
  
--- 345,353 ----
    if (limit)
      {
        register char *p;		/* Find last newline.  */
!       /* Terminate the buffer to avoid confusing TC_EOL_IN_INSN.  */
!       *limit = '\0';
!       for (p = limit - 1; *p != '\n' || TC_EOL_IN_INSN (p); --p)
  	;
        ++p;
  
*************** input_scrub_next_buffer (char **bufp)
*** 368,374 ****
  	      return NULL;
  	    }
  
! 	  for (p = limit - 1; *p != '\n'; --p)
  	    ;
  	  ++p;
  	}
--- 373,381 ----
  	      return NULL;
  	    }
  
! 	  /* Terminate the buffer to avoid confusing TC_EOL_IN_INSN.  */
! 	  *limit = '\0';
! 	  for (p = limit - 1; *p != '\n' || TC_EOL_IN_INSN (p); --p)
  	    ;
  	  ++p;
  	}

      reply	other threads:[~2006-10-16 12:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-05 14:33 Bernd Schmidt
2006-10-13 11:37 ` Nick Clifton
2006-10-16 20:53   ` Bernd Schmidt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4533751B.1020001@t-online.de \
    --to=bernds_cb1@t-online.de \
    --cc=binutils@sources.redhat.com \
    --cc=nickc@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).