]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix DWARF1/C++ abort with member function in class nested in another function.
authorJim Wilson <wilson@cygnus.com>
Wed, 28 Oct 1998 14:09:31 +0000 (14:09 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Wed, 28 Oct 1998 14:09:31 +0000 (06:09 -0800)
* dwarfout.c (dwarfout_file_scope_decl): If DECL_CONTEXT, don't abort
if pending_types is non-zero.
(dwarfout_finish): Verify pending_types is zero before finishing.

From-SVN: r23404

gcc/ChangeLog
gcc/dwarfout.c

index 21ec81f21df80c63e18a2c118c7da163b6ca66ed..a7970e19b11caf29e52566e884a0c96bbaaa7c96 100644 (file)
@@ -1,3 +1,9 @@
+Wed Oct 28 14:06:49 1998  Jim Wilson  <wilson@cygnus.com>
+
+       * dwarfout.c (dwarfout_file_scope_decl): If DECL_CONTEXT, don't abort
+       if pending_types is non-zero.
+       (dwarfout_finish): Verify pending_types is zero before finishing.
+
 Wed Oct 28 10:29:09 1998  Nick Clifton  <nickc@cygnus.com>
 
        * expr.c (convert_move): Use shifts to perform the move if a
index 5c33cfc4d585572c8dcdf71c7a14a8397d9579ab..4ab27474832869619bea553918e1dab40655c68e 100644 (file)
@@ -5257,10 +5257,16 @@ dwarfout_file_scope_decl (decl, set_finalizing)
 
   output_pending_types_for_scope (NULL_TREE);
 
-  /* The above call should have totally emptied the pending_types_list.  */
-
-  if (pending_types != 0)
-    abort ();
+  /* The above call should have totally emptied the pending_types_list
+     if this is not a nested function or class.  If this is a nested type,
+     then the remaining pending_types will be emitted when the containing type
+     is handled.  */
+  
+  if (! DECL_CONTEXT (decl))
+    {
+      if (pending_types != 0)
+       abort ();
+    }
 
   ASM_OUTPUT_POP_SECTION (asm_out_file);
 
@@ -6013,6 +6019,12 @@ dwarfout_finish ()
 
       ASM_OUTPUT_POP_SECTION (asm_out_file);
     }
+
+  /* There should not be any pending types left at the end.  We need
+     this now because it may not have been checked on the last call to
+     dwarfout_file_scope_decl.  */
+  if (pending_types != 0)
+    abort ();
 }
 
 #endif /* DWARF_DEBUGGING_INFO */