summaryrefslogtreecommitdiff
path: root/gcc/dwarfout.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1998-10-28 14:09:31 +0000
committerJim Wilson <wilson@gcc.gnu.org>1998-10-28 06:09:31 -0800
commit0a4be913a4f47e2d22dc63a4b3eb3d851fd6bd6d (patch)
tree7b718909e0464f02fafc2180ff6fa83691cbd1b3 /gcc/dwarfout.c
parent22eed1e6784af1d88a4e0f1773f2d6952c2c493c (diff)
downloadgcc-0a4be913a4f47e2d22dc63a4b3eb3d851fd6bd6d.tar.gz
Fix DWARF1/C++ abort with member function in class nested in another function.
* 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
Diffstat (limited to 'gcc/dwarfout.c')
-rw-r--r--gcc/dwarfout.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c
index 5c33cfc4d58..4ab27474832 100644
--- a/gcc/dwarfout.c
+++ b/gcc/dwarfout.c
@@ -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 */