This is the mail archive of the
mailing list for the GCC project.
cpplib: asm unknown directive fix
- To: gcc-patches at gcc dot gnu dot org
- Subject: cpplib: asm unknown directive fix
- From: Neil Booth <NeilB at earthling dot net>
- Date: Tue, 19 Sep 2000 21:04:55 +0100
I think this fixes the bug where an unknown directive in asm was
processed and then gave EOF <g>. It bit Andreas and Geoff.
If it bootstraps and passes the preprocessor tests, I'll commit it.
In the near future I'm adding a bunch of testcases, and I'll add
something for this.
* cpplex.c (lex_line): Drop the EOF token for unknown
directives in assembler.
RCS file: /cvs/gcc/egcs/gcc/cpplex.c,v
retrieving revision 1.98
diff -u -p -r1.98 cpplex.c
--- cpplex.c 2000/09/18 18:43:04 1.98
+++ cpplex.c 2000/09/19 19:50:24
@@ -1669,11 +1669,6 @@ lex_line (pfile, list)
first->flags |= BOL;
pfile->first_directive_token = first;
- /* Drop the EOF unless really at EOF or in a directive. */
- if (!(cur_token == first || pfile->state.in_directive
- || !pfile->done_initializing))
/* Don't complain about the null directive, nor directives in
assembly source: we don't know where the comments are, and # may
introduce assembler pseudo-ops. Don't complain about invalid
@@ -1696,6 +1691,11 @@ lex_line (pfile, list)
+ /* Drop the EOF unless really at EOF or in a directive. */
+ if (cur_token != first && !KNOWN_DIRECTIVE (list)
+ && pfile->done_initializing)
pfile->state.in_lex_line = 0;