2004-06-01 Michael Chastain <mec.gnu@mindspring.com>

Fix PR symtab/1661.
	* hpread.c (hpread_pxdb_needed): Call memset after alloca.
	(hpread_read_struct_type): Likewise.
This commit is contained in:
Michael Chastain 2004-06-01 22:39:23 +00:00
parent 0451f5dff4
commit d4687fa094
2 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2004-06-01 Michael Chastain <mec.gnu@mindspring.com>
Fix PR symtab/1661.
* hpread.c (hpread_pxdb_needed): Call memset after alloca.
(hpread_read_struct_type): Likewise.
2004-06-01 Andrew Cagney <cagney@gnu.org>
* mi/mi-cmd-env.c (env_execute_cli_command): Use xstrprintf

View File

@ -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);