aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorUros Bizjak <uros@gcc.gnu.org>2005-11-09 07:30:03 +0100
committerUros Bizjak <uros@gcc.gnu.org>2005-11-09 07:30:03 +0100
commit456b8ce5dbc2f77b3506d18c7eaec25cf76cb573 (patch)
treeb078bd18fbfd08b7038db568253cd7312a08964d /libcpp
parent85e77c2176355b95565534e4bee77eb5672ccfe9 (diff)
downloadgcc-456b8ce5dbc2f77b3506d18c7eaec25cf76cb573.zip
gcc-456b8ce5dbc2f77b3506d18c7eaec25cf76cb573.tar.gz
gcc-456b8ce5dbc2f77b3506d18c7eaec25cf76cb573.tar.bz2
re PR c/24101 (Segfault with preprocessed source)
libcpp/ PR c/24101 * init.c (read_original_filename): Temporarily set state.in_directive before calling _cpp_lex_direct for CPP_HASH tokens. gcc/ PR c/24101 * toplev.c (process_options): Initialize debug_hooks early in case lang_hooks.post_options ends up calling a debug_hook. gcc/testsuite/ PR c/24101 * gcc.dg/pr24101-1.i, gcc.dg/pr24101-2.i: New tests. * gcc.dg/dg.exp: Run main loop also for *.i files. From-SVN: r106677
Diffstat (limited to 'libcpp')
-rw-r--r--libcpp/ChangeLog8
-rw-r--r--libcpp/init.c2
2 files changed, 10 insertions, 0 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 3b14dab..747e45a 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -1,3 +1,11 @@
+2005-11-09 Per Bothner <per@bothner.com>
+ Uros Bizjak <uros@kss-loka.si>
+
+ PR c/24101
+ * init.c (read_original_filename): Temporarily set
+ state.in_directive before calling _cpp_lex_direct for
+ CPP_HASH tokens.
+
2005-11-03 James E Wilson <wilson@specifix.com>
PR preprocessor/24202
diff --git a/libcpp/init.c b/libcpp/init.c
index 3074f96..bbf2705 100644
--- a/libcpp/init.c
+++ b/libcpp/init.c
@@ -497,8 +497,10 @@ read_original_filename (cpp_reader *pfile)
token = _cpp_lex_direct (pfile);
if (token->type == CPP_HASH)
{
+ pfile->state.in_directive = 1;
token1 = _cpp_lex_direct (pfile);
_cpp_backup_tokens (pfile, 1);
+ pfile->state.in_directive = 0;
/* If it's a #line directive, handle it. */
if (token1->type == CPP_NUMBER)