diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-03-06 16:18:40 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-03-06 16:18:40 +0000 |
commit | 914db4b784e45909e13d0c229baf49234e4310bb (patch) | |
tree | 81d6fae2161fe976ca587b7a58d10fda41f7e93b /libcpp/directives.c | |
parent | 3687a208b7bfca87fc95ab9e26fa63d0edf474b5 (diff) | |
download | gcc-914db4b784e45909e13d0c229baf49234e4310bb.tar.gz |
PR middle-end/56461
* internal.h (struct cpp_buffer): Add to_free field.
(_cpp_pop_file_buffer): Add third argument.
* files.c (_cpp_stack_file): Set buffer->to_free.
(_cpp_pop_file_buffer): Add to_free argument. Free to_free
if non-NULL, and if equal to file->buffer_start, also clear
file->buffer{,_start,_valid}.
* directives.c (_cpp_pop_buffer): Pass buffer->to_free
to _cpp_pop_file_buffer.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@196497 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp/directives.c')
-rw-r--r-- | libcpp/directives.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libcpp/directives.c b/libcpp/directives.c index 46b86085d83..65b2034d0e2 100644 --- a/libcpp/directives.c +++ b/libcpp/directives.c @@ -2558,6 +2558,7 @@ _cpp_pop_buffer (cpp_reader *pfile) cpp_buffer *buffer = pfile->buffer; struct _cpp_file *inc = buffer->file; struct if_stack *ifs; + const unsigned char *to_free; /* Walk back up the conditional stack till we reach its level at entry to this file, issuing error messages. */ @@ -2571,6 +2572,7 @@ _cpp_pop_buffer (cpp_reader *pfile) /* _cpp_do_file_change expects pfile->buffer to be the new one. */ pfile->buffer = buffer->prev; + to_free = buffer->to_free; free (buffer->notes); /* Free the buffer object now; we may want to push a new buffer @@ -2579,7 +2581,7 @@ _cpp_pop_buffer (cpp_reader *pfile) if (inc) { - _cpp_pop_file_buffer (pfile, inc); + _cpp_pop_file_buffer (pfile, inc, to_free); _cpp_do_file_change (pfile, LC_LEAVE, 0, 0, 0); } |