summaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-30 01:19:46 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-30 01:19:46 +0000
commita8b2a8d55ccf7783b607c4629292af7fc41f6a28 (patch)
tree3f1fe8c9f8d0790aeba0901210cdcacef20a75cd /libcpp
parent4fb8fb2fa3627e273247082737193f592f1be91c (diff)
downloadgcc-a8b2a8d55ccf7783b607c4629292af7fc41f6a28.tar.gz
* directives.c (cpp_handle_deferred_pragma): Save, clear and restore
cb.line_change. Otherwise do_pragma will call the line_change call-back with a meaningless line number. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88320 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog6
-rw-r--r--libcpp/directives.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 839b559fad6..86222aa942c 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,9 @@
+2004-09-29 Per Bothner <per@bothner.com>
+
+ * directives.c (cpp_handle_deferred_pragma): Save, clear and restore
+ cb.line_change. Otherwise do_pragma will call the line_change
+ call-back with a meaningless line number.
+
2004-09-24 Zack Weinberg <zack@codesourcery.com>
* configure.ac: Move AC_PROG_MAKE_SET, AC_PROG_INSTALL to
diff --git a/libcpp/directives.c b/libcpp/directives.c
index 49f95ca3389..b60b7bca800 100644
--- a/libcpp/directives.c
+++ b/libcpp/directives.c
@@ -1419,10 +1419,13 @@ cpp_handle_deferred_pragma (cpp_reader *pfile, const cpp_string *s)
cpp_token *saved_cur_token = pfile->cur_token;
tokenrun *saved_cur_run = pfile->cur_run;
bool saved_defer_pragmas = CPP_OPTION (pfile, defer_pragmas);
+ void (*saved_line_change) (cpp_reader *, const cpp_token *, int)
+ = pfile->cb.line_change;
pfile->context = XNEW (cpp_context);
pfile->context->macro = 0;
pfile->context->prev = 0;
+ pfile->cb.line_change = NULL;
CPP_OPTION (pfile, defer_pragmas) = false;
run_directive (pfile, T_PRAGMA, s->text, s->len);
@@ -1431,6 +1434,7 @@ cpp_handle_deferred_pragma (cpp_reader *pfile, const cpp_string *s)
pfile->context = saved_context;
pfile->cur_token = saved_cur_token;
pfile->cur_run = saved_cur_run;
+ pfile->cb.line_change = saved_line_change;
CPP_OPTION (pfile, defer_pragmas) = saved_defer_pragmas;
}