This patch set for the generic BFD a.out backend removes a dead #define and makes...
[deliverable/binutils-gdb.git] / bfd / dwarf2.c
index 3ee753d0aa4cda8a0c1d6748c5d4ae298a245bed..9ed4a4a2871f03bc88c3c132a25453fe8423ba79 100644 (file)
@@ -2420,8 +2420,7 @@ decode_line_info (struct comp_unit *unit)
                    (_("DWARF error: mangled line number section"));
                  bfd_set_error (bfd_error_bad_value);
                line_fail:
-                 if (filename != NULL)
-                   free (filename);
+                 free (filename);
                  goto fail;
                }
              break;
@@ -2466,8 +2465,7 @@ decode_line_info (struct comp_unit *unit)
                filenum = _bfd_safe_read_leb128 (abfd, line_ptr, &bytes_read,
                                                 FALSE, line_end);
                line_ptr += bytes_read;
-               if (filename)
-                 free (filename);
+               free (filename);
                filename = concat_filename (table, filenum);
                break;
              }
@@ -2513,8 +2511,7 @@ decode_line_info (struct comp_unit *unit)
            }
        }
 
-      if (filename)
-       free (filename);
+      free (filename);
     }
 
   if (unit->line_offset == 0)
@@ -2529,10 +2526,8 @@ decode_line_info (struct comp_unit *unit)
       table->sequences = table->sequences->prev_sequence;
       free (seq);
     }
-  if (table->files != NULL)
-    free (table->files);
-  if (table->dirs != NULL)
-    free (table->dirs);
+  free (table->files);
+  free (table->dirs);
   return NULL;
 }
 
@@ -3379,18 +3374,20 @@ scan_unit_for_symbols (struct comp_unit *unit)
                    {
                      struct varinfo * spec_var;
 
-                     spec_var = lookup_var_by_offset (attr.u.val, unit->variable_table);
+                     spec_var = lookup_var_by_offset (attr.u.val,
+                                                      unit->variable_table);
                      if (spec_var == NULL)
                        {       
-                         _bfd_error_handler
-                           (_("DWARF error: could not find variable specification at offset %lx"),
-                            (unsigned long) attr.u.val);
+                         _bfd_error_handler (_("DWARF error: could not find "
+                                               "variable specification "
+                                               "at offset %lx"),
+                                             (unsigned long) attr.u.val);
                          break;
                        }
 
                      if (var->name == NULL)
                        var->name = spec_var->name;
-                     if (var->file == NULL)
+                     if (var->file == NULL && spec_var->file != NULL)
                        var->file = strdup (spec_var->file);
                      if (var->line == 0)
                        var->line = spec_var->line;
@@ -5144,34 +5141,22 @@ _bfd_dwarf2_cleanup_debug_info (bfd *abfd, void **pinfo)
              free (each->line_table->dirs);
            }
 
-         if (each->lookup_funcinfo_table)
-           {
-             free (each->lookup_funcinfo_table);
-             each->lookup_funcinfo_table = NULL;
-           }
+         free (each->lookup_funcinfo_table);
+         each->lookup_funcinfo_table = NULL;
 
          while (function_table)
            {
-             if (function_table->file)
-               {
-                 free (function_table->file);
-                 function_table->file = NULL;
-               }
-             if (function_table->caller_file)
-               {
-                 free (function_table->caller_file);
-                 function_table->caller_file = NULL;
-               }
+             free (function_table->file);
+             function_table->file = NULL;
+             free (function_table->caller_file);
+             function_table->caller_file = NULL;
              function_table = function_table->prev_func;
            }
 
          while (variable_table)
            {
-             if (variable_table->file)
-               {
-                 free (variable_table->file);
-                 variable_table->file = NULL;
-               }
+             free (variable_table->file);
+             variable_table->file = NULL;
              variable_table = variable_table->prev_var;
            }
        }
This page took 0.025478 seconds and 4 git commands to generate.