From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org, Tom Tromey <tromey@redhat.com>
Subject: Re: RFA: fix crash-causing bug in copy_type_recursive
Date: Mon, 10 Nov 2008 21:22:00 -0000 [thread overview]
Message-ID: <200811102046.13626.pedro@codesourcery.com> (raw)
In-Reply-To: <m3iqqvjrou.fsf@fleche.redhat.com>
On Monday 10 November 2008 19:40:01, Tom Tromey wrote:
> On the Python branch I ran into a crash that was caused by
> copy_type_recursive not clearing the memory for new fields.
> Built and regtested on x86-64 (compile farm).
> Ok? (I almost checked this in as obvious...)
>
Ok.
> @@ -2977,6 +2977,7 @@ copy_type_recursive (struct objfile *objfile,
>
> nfields = TYPE_NFIELDS (type);
> TYPE_FIELDS (new_type) = xmalloc (sizeof (struct field) * nfields);
> + memset (TYPE_FIELDS (new_type), 0, sizeof (struct field) * nfields);
Or xzalloc, or xcalloc, or XCALLOC even.
--
Pedro Alves
next prev parent reply other threads:[~2008-11-10 20:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-10 20:08 Tom Tromey
2008-11-10 20:57 ` Daniel Jacobowitz
2008-11-10 21:22 ` Pedro Alves [this message]
2008-11-10 21:26 ` Tom Tromey
2008-11-10 23:10 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200811102046.13626.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox