From: dpatel Date: Mon, 28 Feb 2005 19:04:19 +0000 (+0000) Subject: * directives.c (do_line): Save sysp early before line table is X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=b0d0794db1566bfc7323663daba93c89bc04ad2a * directives.c (do_line): Save sysp early before line table is realloc'ed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@95691 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog index 5e6ad289e36..1f441b19b9d 100644 --- a/libcpp/ChangeLog +++ b/libcpp/ChangeLog @@ -1,3 +1,8 @@ +2005-02-28 Devang Patel + + * directives.c (do_line): Save sysp early before line table is + realloc'ed. + 2005-02-20 Zack Weinberg PR 18785 diff --git a/libcpp/directives.c b/libcpp/directives.c index 8a6d45ac191..84065052630 100644 --- a/libcpp/directives.c +++ b/libcpp/directives.c @@ -775,6 +775,11 @@ do_line (cpp_reader *pfile) { const struct line_maps *line_table = pfile->line_table; 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 char *new_file = map->to_file; unsigned long new_lineno; @@ -815,7 +820,7 @@ do_line (cpp_reader *pfile) skip_rest_of_line (pfile); _cpp_do_file_change (pfile, LC_RENAME, new_file, new_lineno, - map->sysp); + map_sysp); } /* Interpret the # 44 "file" [flags] notation, which has slightly