summaryrefslogtreecommitdiff
path: root/gcc/c-ppoutput.c
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-02 07:03:42 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2003-10-02 07:03:42 +0000
commita1c7eda2d5ee7ffde5e8ff23e0fec3cea03fea0b (patch)
tree073d54a44fc0257e933d04f1fd0ec4b6ab34ab6e /gcc/c-ppoutput.c
parent30eb963b5f1fe5bd52255805f736b96fd50193c4 (diff)
downloadgcc-a1c7eda2d5ee7ffde5e8ff23e0fec3cea03fea0b.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@72011 138bc75d-0d04-0410-961f-82ee72b054a4
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 669d11ea494..22e595f9541 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;