summaryrefslogtreecommitdiff
path: root/gcc/cppexp.c
diff options
context:
space:
mode:
authorZack Weinberg <zack@gcc.gnu.org>2000-05-30 02:40:48 +0000
committerZack Weinberg <zack@gcc.gnu.org>2000-05-30 02:40:48 +0000
commit37dbf7aa9c7ecd0d04c5caf229023d9e4d911129 (patch)
treed00c4ee461538b9857b27d0d4789a07da42adf5e /gcc/cppexp.c
parent6a3dbe6543fe3d23a1936c3867e9980eec075c15 (diff)
downloadgcc-37dbf7aa9c7ecd0d04c5caf229023d9e4d911129.tar.gz
cpplib.c (do_if): Don't save and restore only_seen_white here.
* cpplib.c (do_if): Don't save and restore only_seen_white here. * cppexp.c (_cpp_parse_expr): Save and restore only_seen_white and skipping here. From-SVN: r34260
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;
}