commit e2a52562d6ba87fc4b4a82a75ae9bb992e8153a1
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Wed Jan 11 16:16:15 2017 +0100
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Wed Jan 11 16:16:15 2017 +0100

    [cc1] Fix continuation after macro expansion
    
    When a macro is expanded a new push up buffer is created,
    but after returning from the macro expansion the original
    buffer can still have pending characters.

diff --git a/cc1/lex.c b/cc1/lex.c
index 130c586..f190154 100644
--- a/cc1/lex.c
+++ b/cc1/lex.c
@@ -207,10 +207,15 @@ readline(void)
        char c, peekc = 0;
 
 repeat_from_file:
-       input->begin = input->p = input->line;
        *input->line = '\0';
+       input->p = input->line;
 
 repeat_from_expand:
+       input->begin = input->p;
+
+       if (*input->begin)
+               return 1;
+
        if (eof)
                return 0;
 

Reply via email to