* dwarf2dbg.c (get_filenum): Skip as-yet unassigned file numbers.
authorRichard Henderson <rth@redhat.com>
Mon, 21 Apr 2003 18:23:25 +0000 (18:23 +0000)
committerRichard Henderson <rth@redhat.com>
Mon, 21 Apr 2003 18:23:25 +0000 (18:23 +0000)
        (out_file_list): Assign non-null filename after generating error.

gas/ChangeLog
gas/dwarf2dbg.c

index 49a22c0611863e020f0d4b15b4f2d3064e610874..01e9528d7b72b503d428f1013c1b9bbb8f82e344 100644 (file)
@@ -1,3 +1,8 @@
+2003-04-21  Richard Henderson  <rth@redhat.com>
+
+        * 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  <jakub@redhat.com>
 
        * ehopt.c (check_eh_frame): For aug_size == 0
index 3b863cd2ec0cc545d4f8f24864b0df6a73207c0e..e58f73a25cfeb16df2dd70e628a84a92c968911c 100644 (file)
@@ -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;
        }