shithub: scc

Download patch

ref: f236a23b80e74546c6c5dc68bfce7fad59dc320c
parent: e5c045851833cfd6b4a8a3326131caf5a406410b
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Jan 11 11:16:15 EST 2017

[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.

--- a/cc1/lex.c
+++ b/cc1/lex.c
@@ -207,10 +207,15 @@
 	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;