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
This commit is contained in:
parent
4168506336
commit
8bfb14674d
@ -1,3 +1,8 @@
|
||||
2002-08-14 Neil Booth <neil@daikokuya.co.uk>
|
||||
|
||||
PR preprocessor/7526
|
||||
* cpplib.c (run_directive): Kludge so _Pragma dependency works.
|
||||
|
||||
2002-08-14 Nathan Sidwell <nathan@codesourcery.com>
|
||||
|
||||
* doc/invoke.texi (-a): Remove documentation.
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
2002-08-14 Neil Booth <neil@daikokuya.co.uk>
|
||||
|
||||
* gcc.dg/cpp/_Pragma3.c: New test.
|
||||
|
||||
2002-08-13 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* g++.dg/template/inherit3: New test.
|
||||
|
11
gcc/testsuite/gcc.dg/cpp/_Pragma3.c
Normal file
11
gcc/testsuite/gcc.dg/cpp/_Pragma3.c
Normal file
@ -0,0 +1,11 @@
|
||||
/* Copyright (C) 2002 Free Software Foundation, Inc. */
|
||||
|
||||
/* { dg-do preprocess } */
|
||||
|
||||
/* Pragma buffers have a NULL "inc" member, which we would dereference
|
||||
when getting a file's date and time.
|
||||
|
||||
Based on PR 7526. 14 Aug 2002. */
|
||||
|
||||
#define GCC_PRAGMA(x) _Pragma (#x)
|
||||
GCC_PRAGMA(GCC dependency "mi1c.h")
|
Loading…
Reference in New Issue
Block a user