From 3f4907a6085f782cb160ea8b41c9ccea9761bbbe Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 23 Jan 2001 12:22:08 -0500 Subject: [PATCH] dwarf2out.c (new_die): Use xcalloc. * dwarf2out.c (new_die): Use xcalloc. (output_die): Abort rather than emit a local reference to offset 0. From-SVN: r39201 --- gcc/ChangeLog | 5 +++++ gcc/dwarf2out.c | 11 +++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 12ba67dd963..59047cb0e2a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2001-01-23 Jason Merrill + + * dwarf2out.c (new_die): Use xcalloc. + (output_die): Abort rather than emit a local reference to offset 0. + 2001-01-17 Andrew Haley * libgcc2.c (get_reg_addr): Don't abort if we haven't got a copy diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index d311dbbbd2f..a3c0e1fae7f 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -4817,16 +4817,9 @@ new_die (tag_value, parent_die) register enum dwarf_tag tag_value; register dw_die_ref parent_die; { - register dw_die_ref die = (dw_die_ref) xmalloc (sizeof (die_node)); + register dw_die_ref die = (dw_die_ref) xcalloc (1, sizeof (die_node)); die->die_tag = tag_value; - die->die_abbrev = 0; - die->die_offset = 0; - die->die_child = NULL; - die->die_parent = NULL; - die->die_sib = NULL; - die->die_attr = NULL; - die->die_symbol = NULL; if (parent_die != NULL) add_child_die (parent_die, die); @@ -6060,6 +6053,8 @@ output_die (die) case dw_val_class_die_ref: if (AT_ref_external (a)) output_symbolic_ref (AT_ref (a)); + else if (AT_ref (a)->die_offset == 0) + abort (); else ASM_OUTPUT_DWARF_DATA (asm_out_file, AT_ref (a)->die_offset); break; -- 2.30.2