scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit e2a52562d6ba87fc4b4a82a75ae9bb992e8153a1
parent e075a0228c63e8bed0a848713569a3b8fe52012c
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed, 11 Jan 2017 16:16:15 +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.

Diffstat:
Mcc1/lex.c | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git 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;