summaryrefslogtreecommitdiff
path: root/gcc/cppexp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cppexp.c')
-rw-r--r--gcc/cppexp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index b50acd8bb3c..58430c331e2 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -843,6 +843,12 @@ _cpp_parse_expr (pfile)
int result;
char buff[5];
+ /* Save parser state and set it to something sane. */
+ int save_only_seen_white = pfile->only_seen_white;
+ int save_skipping = pfile->skipping;
+ pfile->only_seen_white = 0;
+ pfile->skipping = 0;
+
/* We've finished when we try to reduce this. */
top->op = FINISHED;
/* Nifty way to catch missing '('. */
@@ -1162,5 +1168,7 @@ _cpp_parse_expr (pfile)
if (stack != init_stack)
free (stack);
CPP_SET_WRITTEN (pfile, old_written);
+ pfile->only_seen_white = save_only_seen_white;
+ pfile->skipping = save_skipping;
return result;
}