diff options
author | Andreas Schwab <schwab@suse.de> | 2002-01-03 09:41:00 +0000 |
---|---|---|
committer | Andreas Schwab <schwab@gcc.gnu.org> | 2002-01-03 09:41:00 +0000 |
commit | b7e30d8ad0eefc5560ae1e0fbb67ed02a428d874 (patch) | |
tree | cbc23e02d49a928631fef7e5b64be1beb9789c5c /gcc/cpplib.c | |
parent | ff81832f59cff40ccee928693238c92c0347a50e (diff) | |
download | gcc-b7e30d8ad0eefc5560ae1e0fbb67ed02a428d874.zip gcc-b7e30d8ad0eefc5560ae1e0fbb67ed02a428d874.tar.gz gcc-b7e30d8ad0eefc5560ae1e0fbb67ed02a428d874.tar.bz2 |
cppfiles.c (_cpp_pop_file_buffer): Change return type to bool and return true if...
* cppfiles.c (_cpp_pop_file_buffer): Change return type to bool
and return true if _cpp_push_next_buffer pushed a new include
file.
* cpplib.c (_cpp_pop_buffer): Only call obstack_free if
_cpp_pop_file_buffer did not push a new file.
* cpphash.h (_cpp_pop_file_buffer): Update declaration.
From-SVN: r48507
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r-- | gcc/cpplib.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c index ea1d9f8..3746d98 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -1805,6 +1805,7 @@ _cpp_pop_buffer (pfile) { cpp_buffer *buffer = pfile->buffer; struct if_stack *ifs; + bool pushed = false; /* Walk back up the conditional stack till we reach its level at entry to this file, issuing error messages. */ @@ -1819,9 +1820,10 @@ _cpp_pop_buffer (pfile) pfile->buffer = buffer->prev; if (buffer->inc) - _cpp_pop_file_buffer (pfile, buffer->inc); + pushed = _cpp_pop_file_buffer (pfile, buffer->inc); - obstack_free (&pfile->buffer_ob, buffer); + if (!pushed) + obstack_free (&pfile->buffer_ob, buffer); } void |