aboutsummaryrefslogtreecommitdiff
path: root/libcpp/directives.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcpp/directives.c')
-rw-r--r--libcpp/directives.c6
1 files changed, 5 insertions, 1 deletions
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;
}
}