scc

Simple C99 Compiler
Log | Files | Refs | README | LICENSE

commit 67b76eed613de026a4b40fe5ff06aee8834500ed
parent 65d393be241273b385ef13c463cd4ada5aa74e62
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sun, 24 Jan 2016 08:35:41 +0100

Do not recover in "incorrect preprocessor directive"

Diffstat:
cc1/cpp.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/cc1/cpp.c b/cc1/cpp.c @@ -713,8 +713,10 @@ cpp(void) for (bp = clauses; bp->token && bp->token != yytoken; ++bp) /* nothing */; - if (!bp->token) - error("incorrect preprocessor directive"); + if (!bp->token) { + errorp("incorrect preprocessor directive"); + goto error; + } pushctx(); /* create a new context to avoid polish */ (*bp->fun)(); /* the current context, and to get all */ @@ -723,6 +725,7 @@ cpp(void) if (yytoken != EOFTOK && !cppoff) errorp("trailing characters after preprocessor directive"); +error: disexpand = 0; lexmode = CCMODE; namespace = ns;