diff options
author | Neil Booth <neil@daikokuya.co.uk> | 2002-08-14 20:17:55 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2002-08-14 20:17:55 +0000 |
commit | 8bfb14674d5dccd6a1cdd71051dfac643901c4d4 (patch) | |
tree | 8bda098fc62ead108660a24e4d81f6fd4ff0376b /gcc/cpplib.c | |
parent | 4168506336b20c2d834453d98d262f1e1648222c (diff) | |
download | gcc-8bfb14674d5dccd6a1cdd71051dfac643901c4d4.zip gcc-8bfb14674d5dccd6a1cdd71051dfac643901c4d4.tar.gz gcc-8bfb14674d5dccd6a1cdd71051dfac643901c4d4.tar.bz2 |
re PR preprocessor/7526 (cpp0 core dump when _Pragma implies #pragma dependency)
PR preprocessor/7526
* cpplib.c (run_directive): Kludge so _Pragma dependency works.
testsuite:
* gcc.dg/cpp/_Pragma3.c: New test.
From-SVN: r56332
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r-- | gcc/cpplib.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 935a0e0..0e9c4a1 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -459,6 +459,9 @@ run_directive (pfile, dir_no, buf, count) { cpp_push_buffer (pfile, (const uchar *) buf, count, /* from_stage3 */ true, 1); + /* Disgusting hack. */ + if (dir_no == T_PRAGMA) + pfile->buffer->inc = pfile->buffer->prev->inc; start_directive (pfile); /* We don't want a leading # to be interpreted as a directive. */ pfile->buffer->saved_flags = 0; @@ -467,6 +470,8 @@ run_directive (pfile, dir_no, buf, count) prepare_directive_trad (pfile); (void) (*pfile->directive->handler) (pfile); end_directive (pfile, 1); + if (dir_no == T_PRAGMA) + pfile->buffer->inc = NULL; _cpp_pop_buffer (pfile); } |