aboutsummaryrefslogtreecommitdiff
path: root/gas/dwarf2dbg.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2003-04-21 18:23:25 +0000
committerRichard Henderson <rth@redhat.com>2003-04-21 18:23:25 +0000
commit88b4ca40728bd25b9e39c4d146fcbf8dd78149d9 (patch)
treee3949935031ec297b7156befe1152cb6f9f88b04 /gas/dwarf2dbg.c
parent04714b914fe6e2deaf384c77a286df8e95545a73 (diff)
downloadgdb-88b4ca40728bd25b9e39c4d146fcbf8dd78149d9.zip
gdb-88b4ca40728bd25b9e39c4d146fcbf8dd78149d9.tar.gz
gdb-88b4ca40728bd25b9e39c4d146fcbf8dd78149d9.tar.bz2
* dwarf2dbg.c (get_filenum): Skip as-yet unassigned file numbers.
(out_file_list): Assign non-null filename after generating error.
Diffstat (limited to 'gas/dwarf2dbg.c')
-rw-r--r--gas/dwarf2dbg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index 3b863cd..e58f73a 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;
}