aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-ppoutput.c
diff options
context:
space:
mode:
authorPer Bothner <pbothner@apple.com>2003-10-02 07:03:42 +0000
committerPer Bothner <bothner@gcc.gnu.org>2003-10-02 00:03:42 -0700
commitf4b2bde73f84ff3936cba8c8a3773c4c29a038fe (patch)
tree073d54a44fc0257e933d04f1fd0ec4b6ab34ab6e /gcc/c-ppoutput.c
parentefef2a5f2a6d41108e7df6f5d5e881d3073feae6 (diff)
downloadgcc-f4b2bde73f84ff3936cba8c8a3773c4c29a038fe.zip
gcc-f4b2bde73f84ff3936cba8c8a3773c4c29a038fe.tar.gz
gcc-f4b2bde73f84ff3936cba8c8a3773c4c29a038fe.tar.bz2
c-lex.c (fe_file_change): Handle a NULL new_map.
* c-lex.c (fe_file_change): Handle a NULL new_map. * fix-header.c (cb_file_change): Likewise. * c-ppoutput.c (pp_file_change): Likewise. From-SVN: r72011
Diffstat (limited to 'gcc/c-ppoutput.c')
-rw-r--r--gcc/c-ppoutput.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/gcc/c-ppoutput.c b/gcc/c-ppoutput.c
index 669d11e..22e595f 100644
--- a/gcc/c-ppoutput.c
+++ b/gcc/c-ppoutput.c
@@ -346,24 +346,27 @@ pp_file_change (const struct line_map *map)
if (flag_no_line_commands || flag_no_output)
return;
- /* First time? */
- if (print.map == NULL)
+ if (map != NULL)
{
- /* Avoid printing foo.i when the main file is foo.c. */
- if (!cpp_get_options (parse_in)->preprocessed)
- print_line (map, map->from_line, flags);
- }
- else
- {
- /* Bring current file to correct line when entering a new file. */
- if (map->reason == LC_ENTER)
- maybe_print_line (map - 1, map->from_line - 1);
-
- if (map->reason == LC_ENTER)
- flags = " 1";
- else if (map->reason == LC_LEAVE)
- flags = " 2";
- print_line (map, map->from_line, flags);
+ /* First time? */
+ if (print.map == NULL)
+ {
+ /* Avoid printing foo.i when the main file is foo.c. */
+ if (!cpp_get_options (parse_in)->preprocessed)
+ print_line (map, map->from_line, flags);
+ }
+ else
+ {
+ /* Bring current file to correct line when entering a new file. */
+ if (map->reason == LC_ENTER)
+ maybe_print_line (map - 1, map->from_line - 1);
+
+ if (map->reason == LC_ENTER)
+ flags = " 1";
+ else if (map->reason == LC_LEAVE)
+ flags = " 2";
+ print_line (map, map->from_line, flags);
+ }
}
print.map = map;