diff options
author | Bernd Schmidt <bschmidt@redhat.com> | 2016-04-13 11:40:37 +0000 |
---|---|---|
committer | Bernd Schmidt <bschmidt@redhat.com> | 2016-04-13 11:40:37 +0000 |
commit | 6511cc35d19b6a3be45fba875d34a4e638a09b12 (patch) | |
tree | c1e054b9ca95c8f0e55a13d3e32e87ea4179b608 /libcpp | |
parent | f3cfbf3cf2988af50af6920a3296ba52b64d54ec (diff) |
Patch from Roger Orr <rogero@howzatt.demon.co.uk>
PR preprocessor/69650
* directives.c (do_linemarker): Reread map after calling
cpp_get_token.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@234932 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libcpp')
-rw-r--r-- | libcpp/ChangeLog | 7 | ||||
-rw-r--r-- | libcpp/directives.c | 6 |
2 files changed, 12 insertions, 1 deletions
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 583f9542eab..acb8d75dccf 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,10 @@ +2016-04-13 Bernd Schmidt <bschmidt@redhat.com> + + Patch from Roger Orr <rogero@howzatt.demon.co.uk> + PR preprocessor/69650 + * directives.c (do_linemarker): Reread map after calling + cpp_get_token. + 2016-04-06 Richard Henderson <rth@redhat.com> PR preprocessor/61817 diff --git a/libcpp/directives.c b/libcpp/directives.c index 6aa6bd1f86a..1617ff61c3c 100644 --- a/libcpp/directives.c +++ b/libcpp/directives.c @@ -1048,6 +1048,9 @@ do_linemarker (cpp_reader *pfile) if (reason == LC_LEAVE) { + /* Reread map since cpp_get_token can invalidate it with a + reallocation. */ + map = LINEMAPS_LAST_ORDINARY_MAP (line_table); const line_map_ordinary *from; if (MAIN_FILE_P (map) || (new_file @@ -1055,7 +1058,8 @@ do_linemarker (cpp_reader *pfile) && filename_cmp (ORDINARY_MAP_FILE_NAME (from), new_file) != 0)) { cpp_warning (pfile, CPP_W_NONE, - "file \"%s\" linemarker ignored due to incorrect nesting", new_file); + "file \"%s\" linemarker ignored due to " + "incorrect nesting", new_file); return; } } |