assembler skipping \ chars

Nathan Sidwell nathan@codesourcery.com
Sun May 27 17:30:00 GMT 2007


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?

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::         CodeSourcery
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: all.diff
URL: <https://sourceware.org/pipermail/binutils/attachments/20070527/1463d8ed/attachment.ksh>


More information about the Binutils mailing list