From ac650a0a320c369bfc1788e9579dc102576ddc50 Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Thu, 21 Aug 2003 15:57:51 +0000 Subject: [PATCH] cppfiles.c (stack_file): Correctly pass return_at_eof parameter to cpp_push_buffer. * cppfiles.c (stack_file): Correctly pass return_at_eof parameter to cpp_push_buffer. * cpplex.c (_cpp_get_fresh_line): Don't buffer->prev - handled by return_at_eof check. Always call _cpp_pop_buffer at end. From-SVN: r70646 --- gcc/ChangeLog | 7 +++++++ gcc/cppfiles.c | 3 ++- gcc/cpplex.c | 3 --- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6d8de7de8d7..d572aa4efaf 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-08-21 Per Bothner + + * cppfiles.c (stack_file): Correctly pass return_at_eof parameter + to cpp_push_buffer. + * cpplex.c (_cpp_get_fresh_line): Don't buffer->prev - handled + by return_at_eof check. Always call _cpp_pop_buffer at end. + 2003-08-21 Kazu Hirata PR target/11805 diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c index 04f067da9d1..a4edd5da33b 100644 --- a/gcc/cppfiles.c +++ b/gcc/cppfiles.c @@ -615,7 +615,8 @@ stack_file (cpp_reader *pfile, _cpp_file *file, bool import) /* Stack the buffer. */ buffer = cpp_push_buffer (pfile, file->buffer, file->st.st_size, - CPP_OPTION (pfile, preprocessed), 0); + CPP_OPTION (pfile, preprocessed), + ! pfile->buffer); buffer->file = file; /* Initialize controlling macro state. */ diff --git a/gcc/cpplex.c b/gcc/cpplex.c index c3ef88dc060..1c00bdd0c8e 100644 --- a/gcc/cpplex.c +++ b/gcc/cpplex.c @@ -719,9 +719,6 @@ _cpp_get_fresh_line (cpp_reader *pfile) "no newline at end of file"); } - if (!buffer->prev) - return false; - if (buffer->return_at_eof) { _cpp_pop_buffer (pfile); -- 2.30.2