From 88b4ca40728bd25b9e39c4d146fcbf8dd78149d9 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 21 Apr 2003 18:23:25 +0000 Subject: [PATCH] * dwarf2dbg.c (get_filenum): Skip as-yet unassigned file numbers. (out_file_list): Assign non-null filename after generating error. --- gas/ChangeLog | 5 +++++ gas/dwarf2dbg.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/gas/ChangeLog b/gas/ChangeLog index 49a22c0611..01e9528d7b 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2003-04-21 Richard Henderson + + * dwarf2dbg.c (get_filenum): Skip as-yet unassigned file numbers. + (out_file_list): Assign non-null filename after generating error. + 2003-04-18 Jakub Jelinek * ehopt.c (check_eh_frame): For aug_size == 0 diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c index 3b863cd2ec..e58f73a25c 100644 --- a/gas/dwarf2dbg.c +++ b/gas/dwarf2dbg.c @@ -411,6 +411,7 @@ get_filenum (filename, num) { for (i = 1; i < files_in_use; ++i) if (files[i].dir == dir + && files[i].filename && strcmp (file, files[i].filename) == 0) { last_used = i; @@ -1089,6 +1090,8 @@ out_file_list () if (files[i].filename == NULL) { as_bad (_("unassigned file number %ld"), (long) i); + /* Prevent a crash later, particularly for file 1. */ + files[i].filename = ""; continue; }