From d4687fa094995ebeaaee6deb5b59b198af37fdeb Mon Sep 17 00:00:00 2001 From: Michael Chastain Date: Tue, 1 Jun 2004 22:39:23 +0000 Subject: [PATCH] 2004-06-01 Michael Chastain Fix PR symtab/1661. * hpread.c (hpread_pxdb_needed): Call memset after alloca. (hpread_read_struct_type): Likewise. --- gdb/ChangeLog | 6 ++++++ gdb/hpread.c | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fc67b2e99c7..785dd9b32e7 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-06-01 Andrew Cagney * mi/mi-cmd-env.c (env_execute_cli_command): Use xstrprintf diff --git a/gdb/hpread.c b/gdb/hpread.c index b3742d07225..070147335b2 100644 --- a/gdb/hpread.c +++ b/gdb/hpread.c @@ -383,6 +383,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, @@ -450,6 +451,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, @@ -3686,6 +3688,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; @@ -3764,6 +3767,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; @@ -3904,6 +3908,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; @@ -4021,6 +4026,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; @@ -4051,6 +4057,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; @@ -4082,6 +4089,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; @@ -4102,6 +4110,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; @@ -4150,6 +4159,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; @@ -4233,6 +4243,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); -- 2.30.2