Commit 2203a881 by Devang Patel Committed by Devang Patel

directives.c (do_line): Save sysp early before line table is realloc'ed.

       * directives.c (do_line): Save sysp early before line table is
       realloc'ed.

From-SVN: r95691
parent 321cf1f2
2005-02-28 Devang Patel <dpatel@apple.com>
* directives.c (do_line): Save sysp early before line table is
realloc'ed.
2005-02-20 Zack Weinberg <zack@codesourcery.com> 2005-02-20 Zack Weinberg <zack@codesourcery.com>
PR 18785 PR 18785
......
...@@ -775,6 +775,11 @@ do_line (cpp_reader *pfile) ...@@ -775,6 +775,11 @@ do_line (cpp_reader *pfile)
{ {
const struct line_maps *line_table = pfile->line_table; const struct line_maps *line_table = pfile->line_table;
const struct line_map *map = &line_table->maps[line_table->used - 1]; const struct line_map *map = &line_table->maps[line_table->used - 1];
/* skip_rest_of_line() may cause line table to be realloc()ed so note down
sysp right now. */
unsigned char map_sysp = map->sysp;
const cpp_token *token; const cpp_token *token;
const char *new_file = map->to_file; const char *new_file = map->to_file;
unsigned long new_lineno; unsigned long new_lineno;
...@@ -815,7 +820,7 @@ do_line (cpp_reader *pfile) ...@@ -815,7 +820,7 @@ do_line (cpp_reader *pfile)
skip_rest_of_line (pfile); skip_rest_of_line (pfile);
_cpp_do_file_change (pfile, LC_RENAME, new_file, new_lineno, _cpp_do_file_change (pfile, LC_RENAME, new_file, new_lineno,
map->sysp); map_sysp);
} }
/* Interpret the # 44 "file" [flags] notation, which has slightly /* Interpret the # 44 "file" [flags] notation, which has slightly
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment