This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: assembler skipping \ chars
- From: "H. J. Lu" <hjl at lucon dot org>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Sun, 27 May 2007 10:35:41 -0700
- Subject: Re: assembler skipping \ chars
- References: <4659C019.9050302@codesourcery.com>
On Sun, May 27, 2007 at 06:30:01PM +0100, Nathan Sidwell wrote:
> The assembler skips \ chars if they appear in certain positions of the
> input file :(
>
> This is occurring in do_scrub_chars, where we fill an input buffer (usually
> 32768 chars at a time). In some states we'll emit ' \' instead of '\'.
> Unfortunately, if we're at the end of the input buffer, the PUT (' ')
> causes us to exit do_scrub_chars, without saving the '\' character.
>
> This patch changes do_scrub_chars to check whether we're near the end of
> the input buffer before trying to emit the ' \' sequence. If we are, we
> UNGET the '\' and exit immediately.
>
> Our user had the unfortunate case where a macro was appearing near the end
> of an input chunk such that an arg use triggered this bug, leading to
> confusing error messages.
>
> ok?
Can you add a testcase?
H.J.