From: Michael Chastain Date: Tue, 1 Jun 2004 22:44:20 +0000 (+0000) Subject: 2004-06-01 Michael Chastain X-Git-Tag: gdb_6_1_1-20040616-release~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fd4439558d687019f77879b39d2e3e757e7d572e;p=thirdparty%2Fbinutils-gdb.git 2004-06-01 Michael Chastain Fix PR symtab/1661. * hpread.c (hpread_pxdb_needed): Call memset after alloca. (hpread_read_struct_type): Likewise. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c5406abcf3c..0278b018e57 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2004-06-01 Michael Chastain + + Fix PR symtab/1661. + * hpread.c (hpread_pxdb_needed): Call memset after alloca. + (hpread_read_struct_type): Likewise. + 2004-05-14 Michael Chastain Fix PR build/1648. diff --git a/gdb/hpread.c b/gdb/hpread.c index 76e96961f9e..d345a04b974 100644 --- a/gdb/hpread.c +++ b/gdb/hpread.c @@ -385,6 +385,7 @@ hpread_pxdb_needed (bfd *sym_bfd) if (header_section_size == (bfd_size_type) sizeof (DOC_info_PXDB_header)) { buf = alloca (sizeof (DOC_info_PXDB_header)); + memset (buf, 0, sizeof (DOC_info_PXDB_header)); if (!bfd_get_section_contents (sym_bfd, header_section, @@ -452,6 +453,7 @@ hpread_pxdb_needed (bfd *sym_bfd) { buf = alloca (sizeof (PXDB_header)); + memset (buf, 0, sizeof (PXDB_header)); if (!bfd_get_section_contents (sym_bfd, header_section, buf, 0, @@ -3690,6 +3692,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, /* Get space to record the next field/data-member. */ new = (struct nextfield *) alloca (sizeof (struct nextfield)); + memset (new, 0, sizeof (struct nextfield)); new->next = list; list = new; @@ -3768,6 +3771,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, n_templ_args++; /* Allocate and fill in a struct next_template */ t_new = (struct next_template *) alloca (sizeof (struct next_template)); + memset (t_new, 0, sizeof (struct next_template)); t_new->next = t_list; t_list = t_new; t_list->arg.name = VT (objfile) + fieldp->dtempl_arg.name; @@ -3908,6 +3912,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, /* Get space to record this member function */ /* Note: alloca used; this will disappear on routine exit */ fn_new = (struct next_fn_field *) alloca (sizeof (struct next_fn_field)); + memset (fn_new, 0, sizeof (struct next_fn_field)); fn_new->next = fn_list; fn_list = fn_new; @@ -4025,6 +4030,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, /* Get space to record this static member */ new = (struct nextfield *) alloca (sizeof (struct nextfield)); + memset (new, 0, sizeof (struct nextfield)); new->next = list; list = new; @@ -4055,6 +4061,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, warning ("Debug info inconsistent: FIELD of anonymous union doesn't have a_union bit set"); /* Get space to record the next field/data-member. */ new = (struct nextfield *) alloca (sizeof (struct nextfield)); + memset (new, 0, sizeof (struct nextfield)); new->next = list; list = new; @@ -4086,6 +4093,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, warning ("Debug info inconsistent: SVAR field in anonymous union doesn't have a_union bit set"); /* Get space to record the next field/data-member. */ new = (struct nextfield *) alloca (sizeof (struct nextfield)); + memset (new, 0, sizeof (struct nextfield)); new->next = list; list = new; @@ -4106,6 +4114,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, warning ("Debug info inconsistent: DVAR field in anonymous union doesn't have a_union bit set"); /* Get space to record the next field/data-member. */ new = (struct nextfield *) alloca (sizeof (struct nextfield)); + memset (new, 0, sizeof (struct nextfield)); new->next = list; list = new; @@ -4154,6 +4163,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, /* Get space to record the next field/data-member. */ new = (struct nextfield *) alloca (sizeof (struct nextfield)); + memset (new, 0, sizeof (struct nextfield)); new->next = list; list = new; @@ -4237,6 +4247,7 @@ hpread_read_struct_type (dnttpointer hp_type, union dnttentry *dn_bufp, break; i_new = (struct next_instantiation *) alloca (sizeof (struct next_instantiation)); + memset (i_new, 0, sizeof (struct next_instantiation)); i_new->next = i_list; i_list = i_new; i_list->t = hpread_type_lookup (field, objfile);